stream: scrobble listened tracks to ListenBrainz
All checks were successful
continuous-integration/drone/push Build is passing
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:
parent
b04e717f40
commit
d302cf1c88
7 changed files with 163 additions and 2 deletions
|
|
@ -46,6 +46,12 @@ def annotate_uri(path: Path, track: Track) -> str:
|
|||
# stream so the player can show a discreet source indicator.
|
||||
f'origin="{esc(track.origin)}"',
|
||||
]
|
||||
# Canonical MusicBrainz recording MBID when the Canonicalizer found one.
|
||||
# Surfaced on the stream so listeners can scrobble the exact recording to
|
||||
# ListenBrainz (see stream/web.liq /scrobble). Passed explicitly rather than
|
||||
# relying on Liquidsoap re-reading the file tags, which is format-dependent.
|
||||
if track.mbid:
|
||||
fields.append(f'musicbrainz_trackid="{esc(track.mbid)}"')
|
||||
# Web page the track was pulled from, so the player can link back to the
|
||||
# source (see Track.page_url for how it's derived per backend).
|
||||
if track.page_url is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue