Milestone 5: MusicBrainz MBID canonicalizer
Give tracks a source-agnostic identity so the same song from different sources no longer replays in a loop. - Canonicalizer resolves (artist, title) to a MusicBrainz recording MBID (no API key; ~1 req/s, descriptive User-Agent, best-effort). Hits and confirmed misses are cached in SQLite; transient errors are not. - Track.key becomes mbid:<id> when resolved, else a normalized name:<artist>|<title> fallback — still source-agnostic. - Scheduler now owns the authoritative anti-repeat on the canonical key, canonicalizing the drawn track with a bounded retry; providers keep a cheap recent-locator filter to limit retries. - db: canonical_cache table, history.locator column with migration for existing databases, recent_locators(). - Canonicalization can be turned off via RADIEO_CANONICAL_ENABLED=0. Verified: MBID hit/cache/miss, cross-source key collapse, scheduler dodging a recent play, schema migration, and full stack (Navidrome + yt-dlp) with zero Python tracebacks and a valid 192 kbps MP3 stream. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8774f5c2a1
commit
7e0f08b863
11 changed files with 292 additions and 33 deletions
|
|
@ -19,6 +19,13 @@ RADIEO_NAVIDROME_PLAYLIST=Radio
|
|||
RADIEO_WEIGHT_NAVIDROME=3
|
||||
RADIEO_WEIGHT_YTDLP=1
|
||||
|
||||
# --- Canonicalizer MBID (optionnel) ---
|
||||
# Résout (artiste, titre) -> MBID MusicBrainz pour dédupliquer entre sources.
|
||||
# Aucune clé requise. Mettre 0 pour désactiver (clé = (artiste, titre)).
|
||||
RADIEO_CANONICAL_ENABLED=1
|
||||
# User-Agent envoyé à MusicBrainz (qui en exige un, descriptif).
|
||||
RADIEO_USER_AGENT=radieo/0.1 (personal music radio)
|
||||
|
||||
# --- Rétention du cache (optionnel) ---
|
||||
# Nombre de morceaux joués conservés sur disque avant éviction (LRU).
|
||||
RADIEO_RETENTION_KEEP=20
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue