fix(qbzd): re-emit TrackStarted when the same track replays after a stop

The bridge's track-change dedup kept the last track id across a stop,
so stop -> play of the same track produced only PlaybackStateChanged
and consumers treating TrackStarted as now-playing (scrobbler, hooks)
missed the replay. A stop ends the current track: reset the tracker.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Filippo VicentiniandClaude Fable 5 committed 2026-08-18 02:24:21 +02:00
1 parent e336d2d1db
commit 8ec1f3c275
1 file changed
+5
+5
View File
@@ -84,6 +84,11 @@ pub fn spawn(runtime: &Runtime, bus: broadcast::Sender<CoreEvent>, edge: Arc<Not
if last_state != Some(state) {
let _ = bus.send(CoreEvent::PlaybackStateChanged { state });
last_state = Some(state);
// A stop ends the "current track": forget it so replaying the
// same track emits a fresh TrackStarted (scrobbling, hooks).
if state == PlaybackState::Stopped {
last_track_id = 0;
}
}
if ev.is_playing {