Scrobble plays from the UI, and vary suggestions between rebuilds

Scrobbling: the UI reports "now playing" when a song starts, and a listen
once half of it (or 4 minutes) has actually been played. Library songs go
through Subsonic's scrobble endpoint, which keeps play counts and passes
them on to the user's Listenbrainz/Last.fm; YouTube songs go straight to
Listenbrainz with listenbrainz.token. discover.scrobble = false turns it
off. Also stops the previous YouTube video when moving to the next YouTube
song, as it played on while the next was looked up.

Fresher suggestions: each mix's suggestions are a random sample of its
best 3 x discovery_count candidates, weighted by fit squared, rather than
always the top ones. Suggestions left alone for a week expire, and stay
out of the mixes for 60 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jude SouthworthandClaude Opus 5.5 committed 2026-11-24 08:22:57 +00:00
1 parent 39cd2b69f1
commit b75f66c205
18 files changed
+437 -15

No files matched your search

+14 -1
View File
@@ -188,7 +188,11 @@ Each time the mixes are rebuilt, playlistd also looks for new songs for each mix
Listenbrainz user it's for.
Every candidate's MusicBrainz genres are compared with each mix's, and it's suggested in the mix
it fits best (if it fits well enough), skipping songs already in your library.
it fits best (if it fits well enough), skipping songs already in your library. Each mix's
suggestions are picked at random from its best-fitting candidates (three times as many as
`discovery_count`), weighted by how well they fit, so they vary from one rebuild to the next.
A suggestion that's been in a mix for a week without being liked, hidden or listened to expires,
and isn't suggested again for 60 days.
In the UI, songs from your library stream from Subsonic. New songs are found on YouTube with
[yt-dlp](https://github.com/yt-dlp/yt-dlp) on the server (keep it up to date: YouTube changes can
@@ -200,6 +204,14 @@ new song to keep it in "Liked new songs", or hide it so it isn't suggested again
Mobile browsers pause embedded YouTube videos when the screen locks or the tab is in the
background, so new songs only play while the UI is open.
What you play in the UI is scrobbled, following Listenbrainz's rule: "now playing" when a song
starts, and a listen once you've played half of it or 4 minutes, whichever comes first (skipping
ahead doesn't count). Library songs are scrobbled through Subsonic, which keeps their play counts
and passes them on to whatever scrobbling the Subsonic user has set up (in Navidrome, linking
Listenbrainz or Last.fm in its personal settings). New songs from YouTube go straight to
Listenbrainz with `listenbrainz.token`, so without a token they aren't scrobbled. Set
`discover.scrobble` (or `DISCOVER_SCROBBLE`) to `false` to turn scrobbling off.
"Play mix" plays a mix's new songs in random order with songs you already know (the songs in the
mix you've played recently) mixed in evenly, so that `familiar_ratio` of what you hear is familiar.
If a mix has too few known songs to keep that ratio, all of them are used.
@@ -268,6 +280,7 @@ The UI uses these endpoints under `/api/discover`:
| `GET /cover/<cover art id>` | Library cover art from Subsonic |
| `GET /youtube/<suggestion id>?refresh=` | YouTube videos for a suggestion, best first (`refresh` searches again) |
| `PUT /youtube/<suggestion id>` | Remember the video that played (`video_id`) |
| `POST /scrobble` | Scrobble a song played in the UI (`source`: `library` or `youtube`, `id`, `submission`, `started_at`, `duration`, `video_id`) |
and these under `/api/tracked` for tracked playlists: