Add ability to watch a single song #42

Open
opened 2026-03-21 14:14:48 -04:00 by connor · 0 comments
Owner

Description:

Currently users can "Watch All" for an artist (watches all tracks across all release groups) or watch at the album level via the web UI. There's no way to watch a single specific song — for example, adding just one track from an album to the download queue without watching the entire album.

What to change

  1. Frontend — shanty-web/frontend/src/pages/album.rs: Add a "Watch" button to each track row in the album detail table. Currently the table has columns: #, Title, Duration, Status, Lyrics. Add a small button (or icon) in each row that watches just that track.

  2. Frontend API — shanty-web/frontend/src/api.rs: Add a function like watch_track(artist: &str, title: &str, mbid: Option<&str>) that calls the backend to add a single wanted item.

  3. Backend — shanty-web/src/routes/artists.rs or a new route: Add an endpoint like POST /api/tracks/watch with body {"artist": "...", "title": "...", "recording_mbid": "..."}. This should call shanty_watch::add_track() which already exists in shanty-watch/src/library.rs and creates a single wanted item.

  4. The existing shanty_watch::add_track() function (shanty-watch/src/library.rs:200-243) already handles single-track watching — it creates a wanted item with ItemType::Track, checks ownership, and upserts the artist. The backend just needs to expose this via an API endpoint and the frontend needs a button to call it.

  5. Album page context: The album detail page (shanty-web/frontend/src/pages/album.rs) shows tracks from MusicBrainz data (MbAlbumTrack type) which has recording_mbid, title, track_number, etc. The watch button should pass the recording MBID and title to the backend so the wanted item has proper metadata for the sync → download pipeline to find the right track.

Acceptance criteria:

  • Individual track "Watch" button visible on album detail page
  • Clicking it creates a single wanted item for that track
  • The wanted item has the correct artist, title, and recording MBID
  • Works with the existing sync → download pipeline (the track gets downloaded on next "Set Sail")
  • Track status updates to "Wanted" in the album view after watching
**Description:** Currently users can "Watch All" for an artist (watches all tracks across all release groups) or watch at the album level via the web UI. There's no way to watch a single specific song — for example, adding just one track from an album to the download queue without watching the entire album. ### What to change 1. **Frontend — `shanty-web/frontend/src/pages/album.rs`**: Add a "Watch" button to each track row in the album detail table. Currently the table has columns: #, Title, Duration, Status, Lyrics. Add a small button (or icon) in each row that watches just that track. 2. **Frontend API — `shanty-web/frontend/src/api.rs`**: Add a function like `watch_track(artist: &str, title: &str, mbid: Option<&str>)` that calls the backend to add a single wanted item. 3. **Backend — `shanty-web/src/routes/artists.rs` or a new route**: Add an endpoint like `POST /api/tracks/watch` with body `{"artist": "...", "title": "...", "recording_mbid": "..."}`. This should call `shanty_watch::add_track()` which already exists in `shanty-watch/src/library.rs` and creates a single wanted item. 4. **The existing `shanty_watch::add_track()` function** (`shanty-watch/src/library.rs:200-243`) already handles single-track watching — it creates a wanted item with `ItemType::Track`, checks ownership, and upserts the artist. The backend just needs to expose this via an API endpoint and the frontend needs a button to call it. 5. **Album page context**: The album detail page (`shanty-web/frontend/src/pages/album.rs`) shows tracks from MusicBrainz data (`MbAlbumTrack` type) which has `recording_mbid`, `title`, `track_number`, etc. The watch button should pass the recording MBID and title to the backend so the wanted item has proper metadata for the sync → download pipeline to find the right track. **Acceptance criteria:** - [ ] Individual track "Watch" button visible on album detail page - [ ] Clicking it creates a single wanted item for that track - [ ] The wanted item has the correct artist, title, and recording MBID - [ ] Works with the existing sync → download pipeline (the track gets downloaded on next "Set Sail") - [ ] Track status updates to "Wanted" in the album view after watching
connor added the MediumPriority label 2026-03-21 14:20:01 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Shanty/Main#42