Milestone 3: Navidrome (OpenSubsonic) playback provider
Replace the directory-scan queue with a real ingestion pipeline: provider -> fetcher -> cache -> ready queue, driven by a background prefetch thread. - subsonic.py: minimal OpenSubsonic client (salted-token auth, getPlaylists/getPlaylist, raw streaming download). - providers/navidrome.py: pick tracks from a playlist (by name or id), with anti-repeat and periodic playlist reload. - fetchers/subsonic.py: atomic download into the shared cache. - db.py: SQLite state — append-only play history (anti-repeat + stats) and cache_files LRU retention (keep the N most recently played). - queue.py: prefetch buffer + retention on play; graceful degradation to the stream's local-cache fallback when no source is configured. - api.py: GET /next now carries real title/artist metadata. - Config via .env (Navidrome credentials), persistent state/ volume, httpx dependency. Verified end-to-end against a live Navidrome: playlist resolved, tracks downloaded and broadcast, retention and history correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
f8eb0655eb
commit
8c27498632
17 changed files with 594 additions and 71 deletions
15
.env.example
Normal file
15
.env.example
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# radieo — configuration locale. Copier en `.env` et remplir.
|
||||
# docker compose lit automatiquement `.env` pour ces variables.
|
||||
|
||||
# --- Source Navidrome / OpenSubsonic ---
|
||||
# URL de base de ton serveur (sans /rest). Laisser les champs vides désactive
|
||||
# la source : le stream joue alors uniquement les fichiers déjà dans cache/.
|
||||
RADIEO_NAVIDROME_URL=https://navidrome.example.org
|
||||
RADIEO_NAVIDROME_USER=monuser
|
||||
RADIEO_NAVIDROME_PASSWORD=monmotdepasse
|
||||
# Nom OU identifiant de la playlist à diffuser.
|
||||
RADIEO_NAVIDROME_PLAYLIST=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