Files
tonehaus/docs/04-spotify-integration.md
boris dae8f3d999
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m0s
wtf
2025-11-28 02:00:11 +00:00

675 B

Spotify Integration

Credentials

  • Prefer configuring via /admin/settings (stored in DB).
  • Fallback to environment variables SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET.

API client

  • src/Service/SpotifyClient.php
    • Client Credentials token fetch (cached)
    • searchAlbums(q, limit)
    • getAlbum(id) / getAlbums([ids])
    • getAlbumWithTracks(id) fetches metadata plus a hydrated tracklist
    • getAlbumTracks(id) provides the raw paginated track payload when needed
  • The search page builds Spotify fielded queries:
    • album:"...", artist:"...", year:YYYY or year:YYYY-YYYY
    • Optional free-text added to the query