How theeliad/theeliad-spotify-dashboard works
TheEliad Spotify Dashboard lets a user connect a Spotify account, choose playlists to track, and inspect playlist activity and statistics. Its main data-refresh path is the dashboard’s sync action into an observer poll cycle, which fetches Spotify playlist and play data, detects changes, and persists results for dashboard queries. A separate tempo backfill resolves audio previews through Deezer and iTunes, estimates tempo, and caches it. The graph combines excerpted call paths with relationships listed in the SOURCE INDEX; unsampled widget and persistence internals are represented at subsystem level.
Main entry points: sync.py Poll orchestrator · db Playlist and event persistence · backfill.py Tempo backfill · main.py Dashboard app
Components 19
Dashboard
- Dashboard app
src/dashboard/main.py - Account connection
src/dashboard/connect.py - Dashboard widgets
src/dashboard/widgets - Display formatting
src/dashboard/utils/format.py
Spotify access
- OAuth client
src/api/spotify_client.py - Spotify fetchers
src/api - Rate-limit retry
src/api/retry.py
Playlist monitoring
- Poll orchestrator
src/observer/sync.py - Playlist diff
src/observer/diff.py - Change alerts
src/observer/alerts.py
Persistence
- Database access
src/db/db.py - Playlist and event persistence
src/db - SQLite database
src/db
Tempo enrichment
- Preview resolver
src/api/fetch_preview.py - Tempo backfill
src/tempo/backfill.py - Tempo estimator
src/tempo/estimate.py
Other components
- Dashboard user
- Spotify API
- Preview providers
Connections 24
- Dashboard user → Dashboard app: uses
src/dashboard/main.py - Dashboard app → Account connection: renders
src/dashboard/main.py - Dashboard app → Poll orchestrator: starts sync
src/dashboard/main.py - Dashboard app → Dashboard widgets: renders
src/dashboard/main.py - Dashboard widgets → Display formatting: formats display
src/dashboard/widgets/playlist_changes.py - Account connection → OAuth client: uses OAuth
src/dashboard/connect.py - Account connection → Spotify fetchers: fetches account data
src/dashboard/connect.py - Account connection → Playlist and event persistence: saves user selection
src/dashboard/connect.py - OAuth client → Spotify API: authenticates
src/api/spotify_client.py - Spotify fetchers → Spotify API: fetches data
src/api/fetch_playlists.py - Spotify fetchers → Rate-limit retry: uses retry
src/api/fetch_current_user.py - Poll orchestrator → OAuth client: builds client
src/observer/sync.py - Poll orchestrator → Spotify fetchers: fetches playlists
src/observer/sync.py - Poll orchestrator → Playlist and event persistence: loads and writes
src/observer/sync.py - Poll orchestrator → Playlist diff: compares tracks
src/observer/sync.py - Poll orchestrator → Change alerts: writes alert
src/observer/sync.py - Dashboard widgets → Playlist and event persistence: loads dashboard data
src/dashboard/widgets/playlist_bpm.py - Playlist and event persistence → Database access: opens connection
src/db/load_playlist_tracks.py - Database access → SQLite database: reads and writes
src/db/db.py - Tempo backfill → Database access: opens connection
src/tempo/backfill.py - Tempo backfill → Preview resolver: resolves and downloads
src/tempo/backfill.py - Preview resolver → Preview providers: searches providers
src/api/fetch_preview.py - Tempo backfill → Tempo estimator: estimates tempo
src/tempo/backfill.py - Tempo backfill → Playlist and event persistence: caches features
src/tempo/backfill.py