Fix #854: bounds-check for setNextTrack during handleTimePosUpdate

This commit is contained in:
Drew Weymouth
2026-02-13 07:47:19 -08:00
parent d8734083de
commit 497c61e724
+3 -1
View File
@@ -886,7 +886,9 @@ func (p *playbackEngine) handleTimePosUpdate(seeked bool) {
isNearEnd := meta.Type != mediaprovider.MediaItemTypeRadioStation && s.TimePos > meta.Duration.Seconds()-10 isNearEnd := meta.Type != mediaprovider.MediaItemTypeRadioStation && s.TimePos > meta.Duration.Seconds()-10
if p.needToSetNextTrack && isNearEnd { if p.needToSetNextTrack && isNearEnd {
p.needToSetNextTrack = false p.needToSetNextTrack = false
p.setNextTrack(p.nextPlayingIndex()) if nextIdx := p.nextPlayingIndex(); nextIdx >= 0 && nextIdx < len(p.playQueue) {
p.setNextTrack(nextIdx)
}
} }
if p.callbacksDisabled { if p.callbacksDisabled {
return return