The mood screen now shows recommendation cards with thumbnails, a refresh action, and accept/reject buttons. Accepting a library match adds it as a seed immediately; other accepted tracks are marked as queued for download. The player persists the session, queue and current track, restores them paused on the next launch and starts the track on the next tap. While offline the store retries the library sync with exponential backoff, downloads retry three times before failing, and covers plus YT thumbnails are cached for the app's lifetime.
This commit is contained in:
1 parent
2234192dc7
commit
dc719f3e1a
8 files changed
+582
-91
No files matched your search
@@ -24,9 +24,13 @@ The shared module contains the API client, session/cache storage, radio queue, a
|
||||
- Two add-to-mood actions in the player:
|
||||
- **Add to current mood** (the mood of the active radio session)
|
||||
- **Choose another mood** (picker)
|
||||
- YT Music recommendations in the mood editor: refresh on demand, accept or reject candidates, thumbnails, and a clear state for library matches (`Seed added`), accepted-for-download tracks and new picks. Accepting a track the library already has adds it as a seed immediately.
|
||||
- Library search and playback, plus **Shuffle all** to queue the whole library without starting a mood.
|
||||
- **Sleep timer** (15/30/45/60/90 minutes) that pauses playback. On Android the pause is scheduled inside the media service, so it still fires when the app is backgrounded or the task is swiped away.
|
||||
- Offline library cache: moods, songs and the last sync revision are stored locally. When the server is unreachable, downloaded tracks still play.
|
||||
- The play queue and current track are saved locally, so a restart reopens the player paused and resumes on the next tap.
|
||||
- Reconnects automatically with exponential backoff (15s to 5min) while offline.
|
||||
- Downloads retry up to three times before reporting an error; covers and YT thumbnails are cached for the app's lifetime.
|
||||
- Original MP3 downloads with progress state, removal and storage usage.
|
||||
- Session persistence: the login survives app restarts until the token is revoked or expires.
|
||||
- Android background playback through a Media3 `MediaSessionService`: notification, lock-screen and headset controls, audio focus, and playback that survives the app being backgrounded or the task being swiped away.
|
||||
@@ -95,6 +99,8 @@ Android cleartext HTTP is enabled for local development. Use HTTPS in production
|
||||
- **Mood cache** — mood details are stored so the app can open them offline.
|
||||
- **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 deterministic song ID.
|
||||
- **Playback snapshot** — the session, upcoming queue and current track are persisted on every queue change and restored on the next launch.
|
||||
- **Offline retry** — a background loop retries the library sync until the server responds again.
|
||||
|
||||
On startup the app is usable before the network call completes: cached moods and library render immediately, then refresh in the background.
|
||||
|
||||
@@ -133,5 +139,6 @@ The image build performs one warm-up compile (`kotlinNodeJsSetup`, `kotlinYarnSe
|
||||
- The media notification exposes play/pause and seeking. Queue actions (skip, add to mood) stay in the app because the mood session and its events belong to the server.
|
||||
- Desktop playback cannot seek (sequential decoder); pause/resume and skipping work. MP3s are decoded to 16-bit PCM before the line is opened, because Java Sound has no line for the compressed format.
|
||||
- Web downloads are disabled because the browser owns its storage; the app still streams and caches metadata.
|
||||
- YT Music recommendations are displayed when the server provides them; discovery and downloading are server-side roadmap items.
|
||||
- Accepted recommendations that are not in the library wait for the server-side downloader before they can be played.
|
||||
- YT Music discovery runs server-side through `yt-dlp`; downloading accepted tracks that are not in the library is still roadmap.
|
||||
- No iOS target yet. The shared module is ready for one.
|
||||
Reference in new issue
Block a user