Skip to content

Fix playlist playback repeating after 50 videos#775

Merged
damontecres merged 1 commit intodamontecres:mainfrom
HankFreeman1:patch-1
Mar 3, 2026
Merged

Fix playlist playback repeating after 50 videos#775
damontecres merged 1 commit intodamontecres:mainfrom
HankFreeman1:patch-1

Conversation

@HankFreeman1
Copy link
Copy Markdown
Contributor

@HankFreeman1 HankFreeman1 commented Mar 2, 2026

For #767, this PR fixes playlist playback looping back to previously played videos after the initial batch.

The issue was in the playlist prefetch logic in PlaylistPlaybackPage. When the player approached the end of the loaded items and triggered a prefetch, the code used currentIndex (the current playback position) as the starting point for fetching new items, instead of count (the current playlist size). This meant:

  1. Items already in the playlist were being re-fetched from the pager and appended as duplicates
  2. The upper bound currentIndex + PLAYLIST_PREFETCH didn't extend far enough past the existing playlist, so new items beyond the initial batch were never loaded

The fix changes both the range start and upper bound to use count, so new items are always fetched starting from where the playlist currently ends rather than from the current playback position.

I tested locally and this does solve my issue!

Copy link
Copy Markdown
Owner

@damontecres damontecres left a comment

Choose a reason for hiding this comment

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

Good catch, thanks!

@damontecres damontecres merged commit ad9314d into damontecres:main Mar 3, 2026
2 checks passed
@HankFreeman1 HankFreeman1 deleted the patch-1 branch March 4, 2026 01:19
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