fix: keep playback queue anchor in sync when advancing episodes#1026
Merged
PartyDonut merged 2 commits intoJun 14, 2026
Merged
Conversation
The PlaybackQueueState introduced with music playback (DonutWare#1005) anchors nextVideo/previousVideo on mainQueueCurrentId, but the video flow's loadNewVideo reuses oldModel.playbackQueue verbatim and never updates that anchor. As a result, after the first auto-advance the 'Next Up' overlay keeps offering the episode that just started playing, and selecting it reloads the same episode from the start. Call advanceFromCurrentTo when handing the queue state to the new playback model so mainQueueCurrentId tracks the actual current item, matching what the audio queue handler already does via nextTransition.
PartyDonut
previously approved these changes
Jun 14, 2026
PartyDonut
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for fixing this 👍.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
After advancing to the next episode (via the Next-Up overlay, auto-advance timer, or the next/previous controls), the player would keep offering the episode that just started playing as "Next Up" — and selecting it would just reload the same episode from position 0, making it look like playback was stuck in a loop.
The
PlaybackQueueStateintroduced in #1005 anchorsnextVideo/previousVideoonmainQueueCurrentId. The audio queue handler updates that anchor on every transition (viaadvanceFromCurrentTo/nextTransition), butloadNewVideoinplayback_model.darthands the new modeloldModel.playbackQueueunchanged, so the anchor stays pinned to the original episode forever. After the first advance,queue[anchorIdx + 1]resolves to the episode that just became current.This PR calls
advanceFromCurrentTo(currentModel.item.id, newItem.id)before loading the new model, matching the audio path.Issue Being Fixed
Auto-advance / Next-Up gets "stuck" on the same episode after one transition: the overlay shows the currently-playing episode as the next one and selecting it restarts the current episode from the start. Regression from #1005 (
feat: Music playback).No existing issue filed — happy to file one if preferred.
Screenshots / Recordings
N/A — purely a queue-state fix; behavioural.
Tested On
Checklist