Skip to content

Fix continue watching advancing to the next episode before finishing the current one - #3210

Closed
mehdigm4life wants to merge 1 commit into
recloudstream:masterfrom
mehdigm4life:fix/resume-watching-final-minutes
Closed

mehdigm4life wants to merge 1 commit into
recloudstream:masterfrom
mehdigm4life:fix/resume-watching-final-minutes

Conversation

@mehdigm4life

Copy link
Copy Markdown

Issue

When exiting the internal player during the last minutes of an episode — before it actually finished — the Continue Watching row would already show the next episode from the start, even though the current episode was never completed.

The reason: resume progress was saved on a milestone, and setViewPosAndResume immediately switched the "continue watching" entry to the next episode once progress reached 90% of the current one.

Fix

The next episode only becomes the resume target once the current episode has actually finished playing:

  • DataStoreHelper.setViewPosAndResume now takes a completed flag. Unless the video reached its end, the resume entry stays on the current episode (at the position where you left).
  • The completion is recorded where the video truly ends:
    • in GeneratorPlayer.nextEpisode() before advancing to the next episode, and
    • via a new onVideoEnded() callback for when autoplay is disabled and the player stays on the end screen.
  • Added PlayerView.onVideoEnded() so host fragments are notified when playback reaches the end.

Behavior after the fix

  • Leaving an episode at, e.g., 93% → Continue Watching keeps the same episode at 93%.
  • Only finishing/watching to the end moves Continue Watching to the next episode (or removes the show from the row if it was the last episode).

Verified by compiling with :app:compileStableDebugKotlin. No settings or UI changes.

@github-actions
github-actions Bot force-pushed the fix/resume-watching-final-minutes branch from cead83d to 7935f77 Compare September 22, 2026 19:45
@mehdigm4life

mehdigm4life commented Sep 22, 2026

Copy link
Copy Markdown
Author

Closed to reopen a fresh PR with the same changes. (build check need approval)

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.

1 participant