Skip to content

feat: pause playback on app quit#967

Open
mvanhorn wants to merge 1 commit intoaome510:masterfrom
mvanhorn:osc/944-pause-on-quit
Open

feat: pause playback on app quit#967
mvanhorn wants to merge 1 commit intoaome510:masterfrom
mvanhorn:osc/944-pause-on-quit

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented Apr 7, 2026

Summary

Sends a Pause request when the user quits the TUI so playback stops instead of continuing in the background.

Why this matters

If a song is playing and you close the app, it keeps playing through Spotify's servers. Reopening the app later doesn't resume where you left off. Pausing on quit fixes both problems.

Changes

  • spotify_player/src/event/mod.rs: Add PlayerRequest::Pause send in the Command::Quit handler, before setting is_running = false.

The PlayerRequest::Pause handler (in client/mod.rs:296) already checks playback.is_playing, so this is a no-op when nothing is playing. The flume channel send() queues the message synchronously, and the client consumer processes it during the UI loop's refresh sleep before process::exit runs.

Testing

Verified the change compiles and follows the same pattern as other player commands (NextTrack, PreviousTrack, ResumePause) which all use client_pub.send(ClientRequest::Player(...)).

Fixes #944

This contribution was developed with AI assistance (Claude Code).

Send a Pause request before setting is_running to false so playback
stops when the user quits. The PlayerRequest::Pause handler already
guards on is_playing, so this is a no-op when nothing is playing.

Fixes aome510#944
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.

Pause playback on app quit

1 participant