[GH-ISSUE #121] Restore state from where the program stopped last time (autoplay track/playlist) #90

Open
opened 2026-02-28 14:30:32 +03:00 by kerem · 6 comments
Owner

Originally created by @pythonhacker on GitHub (Aug 19, 2021).
Original GitHub issue: https://github.com/jpochyla/psst/issues/121

If I stopped psst when I was playing a track, I would like it to auto-play the same track when I restart psst. Similar to saving volumne and other parameters, can we save the most recently played track in config and restore that state once the program is relaunched ?

Let me know if this makes sense. I will be happy to implement this.

Originally created by @pythonhacker on GitHub (Aug 19, 2021). Original GitHub issue: https://github.com/jpochyla/psst/issues/121 If I stopped psst when I was playing a track, I would like it to auto-play the same track when I restart psst. Similar to saving volumne and other parameters, can we save the most recently played track in config and restore that state once the program is relaunched ? Let me know if this makes sense. I will be happy to implement this.
Author
Owner

@jpochyla commented on GitHub (Aug 20, 2021):

This is definitely wanted. I'd like to as well save and restore the current route. I will eventually get to it, but in case you'd like to tackle this yourself, I'm happy to assist.

<!-- gh-comment-id:902583223 --> @jpochyla commented on GitHub (Aug 20, 2021): This is definitely wanted. I'd like to as well save and restore the current route. I will eventually get to it, but in case you'd like to tackle this yourself, I'm happy to assist.
Author
Owner

@JuliDi commented on GitHub (Aug 21, 2021):

After looking into this issue, it looks to me like you can't easily intercept the QUIT_APP command because it is handled by druid.

It seems like the delegate's command handler github.com/jpochyla/psst@7c2152d559/psst-gui/src/delegate.rs (L53) doesn't receive that command. (In fact, I also tried adding the event() function and couldn't even get any of the close-window events.)

Is there a way to execute some code when the application is quit?

<!-- gh-comment-id:903107973 --> @JuliDi commented on GitHub (Aug 21, 2021): After looking into this issue, it looks to me like you can't easily intercept the [`QUIT_APP`](https://docs.rs/druid/0.7.0/druid/commands/constant.QUIT_APP.html) command because it is handled by druid. It seems like the delegate's command handler https://github.com/jpochyla/psst/blob/7c2152d559411c197536a65b484ab67672bc4725/psst-gui/src/delegate.rs#L53 doesn't receive that command. (In fact, I also tried adding the `event()` function and couldn't even get any of the close-window events.) Is there a way to execute some code when the application is quit?
Author
Owner

@jpochyla commented on GitHub (Aug 24, 2021):

I think we can re-save the config after every route change.

<!-- gh-comment-id:904519378 --> @jpochyla commented on GitHub (Aug 24, 2021): I think we can re-save the config after every route change.
Author
Owner

@JuliDi commented on GitHub (Aug 24, 2021):

So would the route or the playback be serialized and saved to file?

<!-- gh-comment-id:904531814 --> @JuliDi commented on GitHub (Aug 24, 2021): So would the route or the playback be serialized and saved to file?
Author
Owner

@jpochyla commented on GitHub (Aug 28, 2021):

Current route is now stored in config and restored on startup as of 6c31eb3.

<!-- gh-comment-id:907604254 --> @jpochyla commented on GitHub (Aug 28, 2021): Current route is now stored in config and restored on startup as of 6c31eb3.
Author
Owner

@ndbroadbent commented on GitHub (Aug 30, 2023):

I noticed that the route is saved and restored (e.g. the playlist page), but I would also like it to save/restore the currently playing song. When I quit and reopen Psst, I would like it to bring up the previous song in the paused state, so I can hit space bar to continue playing. (This is how the official Spotify client works.) Would that be difficult to add?

<!-- gh-comment-id:1698347738 --> @ndbroadbent commented on GitHub (Aug 30, 2023): I noticed that the route is saved and restored (e.g. the playlist page), but I would also like it to save/restore the currently playing song. When I quit and reopen Psst, I would like it to bring up the previous song in the paused state, so I can hit space bar to continue playing. (This is how the official Spotify client works.) Would that be difficult to add?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#90
No description provided.