From ff7e40fcf8f664a6e9c292b9f6786dba2809529c Mon Sep 17 00:00:00 2001 From: Jente Date: Sat, 13 Jun 2026 19:39:40 +0200 Subject: [PATCH 1/2] fix: advance playback queue when loading next/previous episode The PlaybackQueueState introduced with music playback (#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. --- lib/models/playback/playback_model.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/models/playback/playback_model.dart b/lib/models/playback/playback_model.dart index 997b3a9b2..a3d5ebc8d 100644 --- a/lib/models/playback/playback_model.dart +++ b/lib/models/playback/playback_model.dart @@ -177,8 +177,16 @@ class PlaybackModelHelper { oldModel: currentModel, ); if (newModel == null) return null; - ref.read(videoPlayerProvider.notifier).loadPlaybackItem(newModel, Duration.zero); - return newModel; + // The new model inherits oldModel.playbackQueue verbatim, so its + // mainQueueCurrentId still points at the episode we just left. + // nextVideo/previousVideo anchor on that id, so without this advance + // the auto-next overlay keeps offering the episode that is already + // playing and re-loads it from the start. + final advancedQueue = + currentModel?.playbackQueue.advanceFromCurrentTo(currentModel.item.id, newItem.id); + final modelToLoad = advancedQueue != null ? newModel.updatePlaybackQueue(advancedQueue) : newModel; + ref.read(videoPlayerProvider.notifier).loadPlaybackItem(modelToLoad, Duration.zero); + return modelToLoad; } Future loadTVChannel(ChannelModel? channel) async { From cf2877ae93727f8b5ca32311b46e101e229f93a9 Mon Sep 17 00:00:00 2001 From: PartyDonut <42371342+PartyDonut@users.noreply.github.com> Date: Sun, 14 Jun 2026 10:51:42 +0200 Subject: [PATCH 2/2] Remove comment --- lib/models/playback/playback_model.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/models/playback/playback_model.dart b/lib/models/playback/playback_model.dart index a3d5ebc8d..504b4b81a 100644 --- a/lib/models/playback/playback_model.dart +++ b/lib/models/playback/playback_model.dart @@ -177,11 +177,6 @@ class PlaybackModelHelper { oldModel: currentModel, ); if (newModel == null) return null; - // The new model inherits oldModel.playbackQueue verbatim, so its - // mainQueueCurrentId still points at the episode we just left. - // nextVideo/previousVideo anchor on that id, so without this advance - // the auto-next overlay keeps offering the episode that is already - // playing and re-loads it from the start. final advancedQueue = currentModel?.playbackQueue.advanceFromCurrentTo(currentModel.item.id, newItem.id); final modelToLoad = advancedQueue != null ? newModel.updatePlaybackQueue(advancedQueue) : newModel;