Files
AudioManagerClient/docs/mood-first-client.md
T
TapTap dc270f863c
CI / build (push) Successful in 3m28s
CI / play (push) Skipped
feat: move the client to searchable, downloadable moods
- new mood/song/search/recommendation models and API calls
- AppCache v2 with moods and details only
- Search and Downloads screens; remove Library and Longform
- new mood detail with songs, add music and recommendation states
- song-keyed covers and updated tests/docs
2026-11-15 21:37:39 +00:00

69 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mood-first redesign — client notes
The canonical design and decision log lives in the server repo:
- local: `/home/taptap/AudioManager/docs/design/mood-first.md`
- web: https://gitea.tap-tap.win/TapTap/AudioManager/src/branch/main/docs/design/mood-first.md
Read that first. This file only records the client-side consequences.
## What the client becomes
- Moods are the only content model. No Library, no Longform, no mounted music.
- All music is downloaded on the server from YouTube; the client searches and
adds songs to a mood.
- A mood has **songs** (collection) and **recommendations** (auto-downloaded,
playable in radio, not permanent until added).
- Playback mixes collection and ready recommendations using `collectionPercent`.
- A mood needs at least one song to play.
## Screens
`Moods | MoodDetail | Search | Downloads | Settings`
- **Moods**: mood list, create, global search.
- **MoodDetail**: songs, add music, recommendations (Add / Not interested /
Retry), next batch, mood settings (query, genres, collectionPercent,
recommendationCount 0–30, refreshHours).
- **Search**: remote YouTube search, results over 10 minutes hidden, add to the
current or a chosen mood, already-downloaded/in-mood badges, paste URL.
- **Downloads**: device-side offline files, delete/clear, storage usage.
- **Settings**: server/account/devices/logout (no scan UI).
Remove `LibraryScreen` and all longform UI.
## State/API changes
- Remove `library`, `longform`, `longformResults`, `longformProgress`,
`musicResults`, local `searchResults`, `playAll`, `playLongform*`,
`resumeLongform`, longform progress reporting.
- Add remote search state (`searchResults`, `searchTargetMoodId`), add/remove
song, recommendation add/reject/retry, mood song counts.
- `CachedState` becomes version 2 with moods + mood details only; invalidate old
caches.
- `SongDto` gains `videoId` and `thumbnail`; loses folder/album-id/path/genres.
- Cover art is song-keyed: `coverUrl(songId)`.
- Playback snapshot/history, desktop seek, Android media session, sleep timer
and device downloads remain.
- Offline mood playback uses device downloads and cached mood details.
## Implementation status (2026-11-15)
Implemented. Concretely:
- `Models.kt` reflects the mood-first DTOs: `Song(videoId, thumbnail)`,
`Mood(collectionPercent, recommendationCount, song counts)`,
`MoodSong`, `Recommendation(song, download)`, `SearchResult`.
- `ApiClient` uses `/moods/{id}/songs`, `/search`, recommendation
`add|reject|retry`, and `/songs/{id}/cover`.
- `AppCache` (version 2) stores moods and details only; old cache shapes are
discarded. Session and playback snapshots are kept.
- `AppStore` has `Moods | MoodDetail | Search | Downloads | Settings`, remote
search with a target mood, add/remove song, recommendation actions, offline
playback from device downloads, and no longform/library paths.
- The UI has a dedicated Search screen (mood picker, paste URL, downloaded
badges) and a Downloads screen. Mood Detail shows songs, add music,
recommendation states and the new options. The player keeps queue editing,
previous/seek and the sleep timer.
- Device downloads store covers by song id (`<songId>.jpg`).