Skip to content

GitHub profile now-playing widget: enrich the now-playing cloud sync#349

Merged
LargeModGames merged 4 commits into
mainfrom
feature/github-widget
Jul 9, 2026
Merged

GitHub profile now-playing widget: enrich the now-playing cloud sync#349
LargeModGames merged 4 commits into
mainfrom
feature/github-widget

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Jul 8, 2026

Copy link
Copy Markdown
Owner

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.

  • The push to POST /api/sync/now-playing now includes album, image_url, duration_ms, progress_ms with a client sample timestamp (progress_at_ms), is_playing, and is_live. The backend (already deployed) extrapolates the widget's progress bar from the timestamp between heartbeats and stays compatible with older clients.
  • New PlaybackSnapshot.is_live flag, set only by internet radio, so the widget can render a LIVE badge instead of a progress bar.
  • Push triggers extracted into a unit-tested 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.
  • Stopping playback mid-session now clears the cloud status right away instead of waiting for app exit.
  • The collector uses the shared timeout-guarded HTTP client instead of an un-timed reqwest::Client::new().
  • SPOTATUI_SYNC_BASE_URL env override points all sync endpoints at a local backend for development.

Testing

  • cargo fmt / clippy -D warnings / cargo test under the CI feature set: 361 tests pass, including new tests for the payload wire format and every tracker trigger.
  • cargo check on default and all-sources feature sets (the radio is_live branch).
  • Wire contract exercised end-to-end against the real backend locally (curl with identical JSON through the deployed migration and widget renderer).

…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
@LargeModGames LargeModGames merged commit 60de579 into main Jul 9, 2026
15 checks passed
@LargeModGames LargeModGames deleted the feature/github-widget branch July 9, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant