Skip to content

fix: keep playback queue anchor in sync when advancing episodes#1026

Merged
PartyDonut merged 2 commits into
DonutWare:developfrom
JenteJan:fix/playback-queue-advance-next-episode
Jun 14, 2026
Merged

fix: keep playback queue anchor in sync when advancing episodes#1026
PartyDonut merged 2 commits into
DonutWare:developfrom
JenteJan:fix/playback-queue-advance-next-episode

Conversation

@JenteJan

Copy link
Copy Markdown
Contributor

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 PlaybackQueueState introduced in #1005 anchors nextVideo / previousVideo on mainQueueCurrentId. The audio queue handler updates that anchor on every transition (via advanceFromCurrentTo / nextTransition), but loadNewVideo in playback_model.dart hands the new model oldModel.playbackQueue unchanged, 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

  • Windows
  • Android
  • Android TV
  • iOS
  • Linux
  • macOS
  • Web

Checklist

  • No new package was added
  • Changes are scoped to the issue at hand (one file, one call site)

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
PartyDonut previously approved these changes Jun 14, 2026

@PartyDonut PartyDonut left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 👍.

@PartyDonut PartyDonut enabled auto-merge (squash) June 14, 2026 08:52
@PartyDonut PartyDonut disabled auto-merge June 14, 2026 08:53
@PartyDonut PartyDonut merged commit dc33089 into DonutWare:develop Jun 14, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants