Skip to content

Conversation

@mbelinky
Copy link

@mbelinky mbelinky commented Feb 8, 2026

Summary

This improves reliability of spogo status (especially with the connect engine) when Spotify connect-state payloads omit track/device metadata, and upgrades device management ergonomics.

Problem

Some devices/sessions return sparse connect-state payloads where the currently playing item has a URI/ID but no name/album, and the active device has little to no metadata. This made status outputs inconsistent (track/device fields often empty) and could lead to slow/hanging status calls when fallback paths were slow.

Fix

  • Connect playback/status now performs best-effort metadata hydration via Web API:
    • Use Web API /me/player to fill missing track/device fields when available.
    • If the track still lacks a name, hydrate via Web API GetTrack first (fast), then fall back to the existing connect GraphQL trackInfo.
    • If device metadata is missing, hydrate via /me/player/devices by ID, and as a last resort pick the single active Web API device.
  • Hydration calls are bounded with short per-call timeouts so status --json stays responsive under automation.
  • Improve connect-state parsing for more playback/device shapes (metadata keys, track_window, etc).

Device UX

  • Add spogo device show and spogo device clear.
  • Add spogo device set --save to persist selection to the current profile.
  • Add a shared resolver for device selection with exact and unique partial matches (name/id).
  • connect engine honors --device/profile device by auto-transferring before playback commands.

Tests

  • Added unit tests covering connect status hydration paths (track/device), device selection resolver, and CLI device commands.
  • Updated test HTTP helpers to include ContentLength so Web API JSON decoding behavior matches production client logic.

Docs

  • Document new device subcommands and note connect status hydration behavior in README/spec/changelog.

- Hydrate connect status track/device metadata via Web API best-effort with bounded timeouts

- Improve connect-state item parsing for sparse payloads

- Enhance device commands (show/clear, set --save) and selector matching

- Add tests for hydration, device selection, and CLI behaviors
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