Skip to content

fix(spotify): make Start Spotify on TV idempotent #31

Description

@postigodev

Summary

Start Spotify on TV can currently pause playback when Spotify is already playing on the selected TV target.

Current behavior

spotify::start_on_tv() prepares the Fire TV session and then calls toggle_on_tv().

toggle_on_tv() intentionally toggles playback: when the selected TV is already the active playback device and playback is running, it calls pause_playback().

That means an action named Start Spotify on TV can produce Paused Spotify on ....

Expected behavior

Start Spotify on TV should be idempotent with respect to an already-running TV session:

  • connect/wake the Fire TV as needed
  • launch Spotify on Fire TV as needed
  • ensure playback is routed to the selected TV target
  • resume/start playback when necessary
  • leave playback running when it is already running on that target

The explicit play/pause action can keep toggle semantics.

Acceptance criteria

  • start_on_tv() no longer uses a toggle operation whose success path can pause playback
  • invoking Start while playback is already active on the target does not pause it
  • invoking Start while playback is elsewhere routes/resumes it on the target
  • existing explicit playback-toggle behavior remains unchanged
  • add focused regression coverage for the already-playing-on-target case

Likely files

  • crates/core/src/spotify/mod.rs
  • associated Spotify tests

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRust or native backend workbugSomething is broken or incorrectspotifySpotify auth, routing, or playback logic

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions