Send Changed event after song change even if we stop playback.

This commit is contained in:
Simon Persson 2018-02-20 22:03:21 +01:00
parent 0a6825ba61
commit 3e2e6d63f7

View file

@ -346,6 +346,15 @@ impl PlayerInternal {
decoder: decoder, decoder: decoder,
end_of_track: end_of_track, 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 }); self.send_event(PlayerEvent::Stopped { track_id });
} }
} }