From 3e2e6d63f7c3a6216d49ddb1d57c7f89c09a6981 Mon Sep 17 00:00:00 2001 From: Simon Persson Date: Tue, 20 Feb 2018 22:03:21 +0100 Subject: [PATCH] Send Changed event after song change even if we stop playback. --- playback/src/player.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/playback/src/player.rs b/playback/src/player.rs index 7438b744..ebf24411 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -346,6 +346,15 @@ impl PlayerInternal { decoder: decoder, end_of_track: end_of_track, }; + match self.state { + PlayerState::Playing { track_id: old_track_id, ..} + | PlayerState::EndOfTrack { track_id: old_track_id, .. } => + self.send_event(PlayerEvent::Changed { + old_track_id: old_track_id, + new_track_id: track_id + }), + _ => (), + } self.send_event(PlayerEvent::Stopped { track_id }); } }