fix: show a new track started at the index that was playing
The player reported a track only when the queue index changed, to drop the repeat stream-start messages playbin posts for one track. Starting another album at the same index (track 1 after track 1) therefore sent no event: the app kept the old track on screen, and pause said nothing was playing, because it had cleared the current track while waiting for that event. A stream-start that begins a track the player was asked to start is now always reported. Only repeats within one track are dropped, and the app treats every report as a new play, so replaying the current track resets its position and scrobbles again.
This commit is contained in:
+2
-3
@@ -1519,10 +1519,9 @@ impl App {
|
||||
self.ui.set_np_paused(p);
|
||||
}
|
||||
PlayerEvent::Track(t) => {
|
||||
// Reported once per track started, so the same index again is a
|
||||
// new play: another queue started there, or the track replayed.
|
||||
let t = t.filter(|&i| i < self.queue.len());
|
||||
if t == self.current {
|
||||
return;
|
||||
}
|
||||
self.current = t;
|
||||
self.position = 0.0;
|
||||
self.scrobbled = false;
|
||||
|
||||
Reference in New Issue
Block a user