feat: search YouTube Music and poll for the first recommendation batch
CI / build (push) Successful in 12m2s
CI / play (push) Successful in 3m18s

- label and document the YouTube Music search source
- allow up to 60s for a search and request ten results
- keep refreshing a new mood until its first recommendations arrive
This commit is contained in:
TapTap committed 2026-11-16 18:38:58 +00:00
1 parent c896f81306
commit 96ab25a91d
6 files changed
+32 -15

No files matched your search

+8 -5
View File
@@ -5,7 +5,7 @@ self-hosted music server.
The client and server are designed together. There is no OpenSubsonic
compatibility layer: the app speaks the native `/api/v1` API, where playback is
a server-driven radio session and songs are added by searching YouTube.
a server-driven radio session and songs are added by searching YouTube Music.
## Targets
@@ -22,8 +22,9 @@ a server-driven radio session and songs are added by searching YouTube.
- **Moods** are the only content model. Each user sees only their own moods.
- **Songs** belong to the mood's permanent collection. A mood needs at least one
song before it can play.
- **Search YouTube** from inside a mood or globally with a mood picker. Tracks
over 10 minutes are hidden. Results that are already downloaded are marked and
- **Search YouTube Music** from inside a mood or globally with a mood picker.
Results are canonical songs with artist, album and duration; tracks over 10
minutes are hidden. Results that are already downloaded are marked and
add instantly; other videos are queued for server-side download.
- **Paste a YouTube URL** to add a specific video.
- **Recommendations** are downloaded automatically and play in the radio without
@@ -69,7 +70,7 @@ a server-driven radio session and songs are added by searching YouTube.
- **Moods** — grid with song and pick counts, create, global search.
- **Mood Detail** — songs, add music, recommendations, next batch, settings.
- **Search** — mood picker, YouTube search, paste URL, downloaded badges.
- **Search** — mood picker, YouTube Music search, paste URL, downloaded badges.
- **Downloads** — offline files and storage usage.
- **Settings** — account, server URL, offline storage, sign out.
@@ -204,7 +205,7 @@ it. It owns:
- **Mood sync** — GET `/moods` on login/refresh; details are fetched when a mood
is opened and cached.
- **Mood cache** — cached details power offline mood lists and downloads.
- **Search** — debounced remote YouTube search with the selected target mood.
- **Search** — debounced remote YouTube Music search with the selected target mood.
- **Radio** — one session per mood, batches of 12, prefetch when the queue is
short, no repeats within a session.
- **Downloads** — stored under the platform app directory, keyed by the shared
@@ -266,4 +267,6 @@ scripts/build-ci-image.sh 3
in-app cover and the Android notification artwork survive without the server.
- Search and downloads depend on `yt-dlp` on the server. YouTube bot checks can
fail a search (`502`) or leave a recommendation in `failed` with Retry.
Music search resolves every result for its artist/album/duration, so a search
takes roughly 10–15 seconds for ten results.
- No iOS target yet. The shared module is ready for one.