stream: scrobble listened tracks to ListenBrainz
All checks were successful
continuous-integration/drone/push Build is passing

The web player decides when a track counts as listened (caught near its
start and heard to ~90%, capped at 4 min) and triggers POST /scrobble.
The token stays server-side (RADIEO_LISTENBRAINZ_TOKEN), submitting the
listen with the canonical MusicBrainz MBID when available. Each airing is
deduplicated so multiple tabs submit it once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-07-04 17:51:41 +08:00
commit d302cf1c88
7 changed files with 163 additions and 2 deletions

View file

@ -113,7 +113,25 @@ ListenBrainz only *names* tracks; each suggestion is resolved to a concrete file
MusicBrainz MBID the feed already carries. Leave the variable empty to disable.
A local file path under `config/` also works for testing.
### 5. Run it
### 5. Scrobbling to ListenBrainz (optional)
Set `RADIEO_LISTENBRAINZ_TOKEN` (in `.env`) to your ListenBrainz *user token*
(from <https://listenbrainz.org/settings/>) to scrobble what you listen to:
```
RADIEO_LISTENBRAINZ_TOKEN=<your-user-token>
```
The web player decides when a track counts as *listened* — caught near its
start (server position < 10 s) and actually heard to ~90 % of its length (capped
at 4 min, ListenBrainz's own rule) — then triggers `POST /scrobble`. The token
stays server-side (never exposed to the browser); the stream submits the listen,
using the canonical MusicBrainz MBID when the canonicalizer found one. Only
listeners on the web page scrobble (external players like VLC don't), and each
airing is submitted once even with several tabs open. Leave the variable empty
to disable.
### 6. Run it
```sh
docker compose up -d