mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #154] [MERGED] Run onstart/onstop when a new song is loaded #814
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#814
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/154
Author: @SimonTeixidor
Created: 2/14/2018
Status: ✅ Merged
Merged: 2/25/2018
Merged by: @sashahilton00
Base:
master← Head:events-on-prev-next📝 Commits (10+)
77bea07Run onstart/onstop when a new song is loadedb0ee031First attempt at a better playback event system.1b943d0Move PlayerEvent into player.0a6825bAdd playing_to_end_of_track method to PlayerState.3e2e6d6Send Changed event after song change even if we stop playback.ef48afbSimplify match with if let.081a282Removed unreachable cases.2eb4aa6Use single program on events, and pass events in envars.93af49aSend player event messages over futures aware channel.23d3c15Just spawn event handlers, don't wait for exit code.📊 Changes
4 files changed (+130 additions, -72 deletions)
View changed files
📝
playback/src/config.rs(+1 -5)📝
playback/src/player.rs(+72 -61)📝
src/main.rs(+24 -6)➕
src/player_event_handler.rs(+33 -0)📄 Description
This PR introduces two changes:
The previous behaviour was that onstop/onstart were only run if the state went from playing => !playing or !playing => playing. The new behaviour is useful for scripts where you want to run a script on every new song. I would argue that there is a brief stop between two songs, so the names still make sense :)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.