Describe the bug
When the native queue is playing a queued Spotify track, the playbar shows that track, but Play/Pause does not pause it. App::toggle_playback skips every per-source arm, reaches the streaming branch, finds no item on current_playback_context, and dispatches a bare IoEvent::StartPlayback(None, None, None). Neither queue router consumes that, so it lands on the Web API as a plain resume. The queued track keeps playing and the API either errors with no active device or resumes the last Spotify context on top of it.
To Reproduce
- Default build, signed in, nothing playing yet, so
current_playback_context has no item.
- Press
z on a Spotify track to add it to the native queue.
- Open the Queue screen and press Enter on it. The queue slot takes over and the playbar shows the queued track.
- Click Play/Pause on the playbar, or press the play key.
- The track keeps playing. Nothing pauses.
Expected behavior
Play/Pause should pause and resume the queued track through librespot, like the other controls on that playbar do.
Root cause
toggle_playback (src/core/app.rs) skips the per-source arms when queue_now_is_spotify() is true, then falls into the streaming branch. With current_playback_context.item == None it takes the bare-resume path and dispatches StartPlayback(None, None, None). route_spotify_queue_transport (src/infra/queue/dispatch.rs) only matches NextTrack, PreviousTrack and ForcePreviousTrack, and the relinquish arm only matches StartPlayback(Some(_), ..), so nothing intercepts it and the runtime forwards it to handle_network_event.
Two ways out: let route_spotify_queue_transport consume PausePlayback and a bare StartPlayback for the Spotify slot, or have toggle_playback call streaming_player.pause()/play() directly when queue_now_is_spotify().
Additional context
Found while reviewing #373, not caused by it. Volume has the same shape in the sub-state where is_streaming_active is false: the dispatched ChangeVolume isn't consumed by either queue router either, so it goes to the Web API instead of librespot.
Describe the bug
When the native queue is playing a queued Spotify track, the playbar shows that track, but Play/Pause does not pause it.
App::toggle_playbackskips every per-source arm, reaches the streaming branch, finds no item oncurrent_playback_context, and dispatches a bareIoEvent::StartPlayback(None, None, None). Neither queue router consumes that, so it lands on the Web API as a plain resume. The queued track keeps playing and the API either errors with no active device or resumes the last Spotify context on top of it.To Reproduce
current_playback_contexthas no item.zon a Spotify track to add it to the native queue.Expected behavior
Play/Pause should pause and resume the queued track through librespot, like the other controls on that playbar do.
Root cause
toggle_playback(src/core/app.rs) skips the per-source arms whenqueue_now_is_spotify()is true, then falls into the streaming branch. Withcurrent_playback_context.item == Noneit takes the bare-resume path and dispatchesStartPlayback(None, None, None).route_spotify_queue_transport(src/infra/queue/dispatch.rs) only matches NextTrack, PreviousTrack and ForcePreviousTrack, and the relinquish arm only matchesStartPlayback(Some(_), ..), so nothing intercepts it and the runtime forwards it tohandle_network_event.Two ways out: let
route_spotify_queue_transportconsume PausePlayback and a bare StartPlayback for the Spotify slot, or havetoggle_playbackcallstreaming_player.pause()/play()directly whenqueue_now_is_spotify().Additional context
Found while reviewing #373, not caused by it. Volume has the same shape in the sub-state where
is_streaming_activeis false: the dispatchedChangeVolumeisn't consumed by either queue router either, so it goes to the Web API instead of librespot.