Add multi-provider album art and harden Spotify auth/polling - #1
Open
crithitstudio wants to merge 2 commits into
Open
Add multi-provider album art and harden Spotify auth/polling#1crithitstudio wants to merge 2 commits into
crithitstudio wants to merge 2 commits into
Conversation
Improve robustness for auth callback timeouts, token cache handling, rate limiting behavior, and rendering performance. - Bound currently-playing retry flow on 401 responses - Preserve playback state on 429 rate limits - Add configurable OAuth callback timeout - Save token cache atomically with stricter permissions - Recover from corrupt token cache files - Cache album-art disk prep work across frames - Document live smoke-test commands in README
Abstract playback behind a PlaybackProvider protocol and support multiple sources for the spinning album art: - Spotify (default): live currently-playing via the Web API. - Last.fm: universal best-effort provider that reads the "now scrobbling" track, so any service that scrobbles (Spotify, Apple Music, Tidal, Deezer, ...) can drive the display from one free, headless, cloud-pollable endpoint. - YouTube Music: most-recent history via ytmusicapi. Apple Music has no native provider: its cloud API exposes no live now-playing endpoint and its credentials require a paid Apple Developer Program membership, neither of which fits a headless wall display. Documented this (and the Last.fm scrobble workaround) in the README provider-support section. Generalize the poller and rate-limit error across providers and add --provider plus the matching env/config for each.
crithitstudio
force-pushed
the
crithitstudio-fix-repo-audit-issues
branch
from
June 26, 2026 20:49
ae0f9d4 to
6253dd4
Compare
Owner
|
Oh nice!!! I'll take a look at this this week :)! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related improvements to the now-playing matrix:
PlaybackProviderinterface so the matrix can be driven by more than just Spotify.Providers
spotify(default) — live currently-playing via the Spotify Web API. Exact and real-time.lastfm— universal best-effort provider. Reads the Last.fm "now scrobbling" track, so any service that scrobbles (Spotify, Apple Music, Tidal, Deezer, YouTube Music, …) can drive the display from one free, headless, cloud-pollable endpoint.youtube-music— most-recent history viaytmusicapi(unofficial, best-effort).Why no Apple Music provider
A direct Apple Music provider isn't feasible for a hands-off, headless wall display:
.p8key, which requires a paid Apple Developer Program membership (~$99/€99/yr).Workaround (documented): scrobble Apple Music to Last.fm and run
--provider lastfm.Changes
Hardening
--auth-timeout-seconds.Multi-provider
PlaybackProviderprotocol;SpotifyClient,LastFmClient,YouTubeMusicClientimplementget_playback_art().poll_provider) and rate-limit error (ProviderRateLimitError) across providers.--provider {spotify,youtube-music,lastfm}flag and per-provider env/config (LASTFM_API_KEY,LASTFM_USER,YTMUSIC_AUTH_HEADERS_PATH).nowplayingscrobble; historical scrobbles render idle (no stale art)..env.exampleupdated; Apple Music env vars removed.Verification
python -m py_compile spotify_matrix.pypasses.python spotify_matrix.py --preview-frames /tmp/spotify-matrix-previewrenders sample frames.LastFmClientparsing unit-tested against now-playing, historical-only, empty, bad-key, and single-object payloads.