GitHub profile now-playing widget: enrich the now-playing cloud sync#349
Merged
Conversation
…e widget The now-playing push to spotatui.com now carries album, cover-art URL, duration, progress with a client sample timestamp, play/pause state, and a LIVE flag for internet radio (new PlaybackSnapshot.is_live). Pushes fire on track change, play/pause flips, seeks, and a heartbeat that keeps running while paused; stopping playback mid-session now clears the cloud status instead of waiting for exit. The collector uses the shared timeout-guarded HTTP client, and SPOTATUI_SYNC_BASE_URL can point syncs at a local backend for development. Claude-Session: https://claude.ai/code/session_01NaYdqk2Axuyzd3LKPaJKGP
…Ls, reuse shared HTTP client
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.
What
Powers the new public GitHub profile widget (
https://spotatui.com/widget/<username>.svg, opt-in via the spotatui.com dashboard) by enriching the client's now-playing cloud sync.POST /api/sync/now-playingnow includesalbum,image_url,duration_ms,progress_mswith a client sample timestamp (progress_at_ms),is_playing, andis_live. The backend (already deployed) extrapolates the widget's progress bar from the timestamp between heartbeats and stays compatible with older clients.PlaybackSnapshot.is_liveflag, set only by internet radio, so the widget can render a LIVE badge instead of a progress bar.NowPlayingTracker: track change (as before), play/pause flips (immediate paused card), seek discontinuities > 5s, and a heartbeat that now also runs while paused so the widget shows "paused" instead of decaying to offline. Note: this keeps the dashboard online dot lit while paused with the app open.reqwest::Client::new().SPOTATUI_SYNC_BASE_URLenv override points all sync endpoints at a local backend for development.Testing
cargo fmt/clippy -D warnings/cargo testunder the CI feature set: 361 tests pass, including new tests for the payload wire format and every tracker trigger.cargo checkon default andall-sourcesfeature sets (the radiois_livebranch).