Skip to content

Skip an unresolvable Next Up episode instead of stalling playback (issue #240) - #241

Merged
mapitman merged 1 commit into
mainfrom
fix-auto-advance-skip-blocked-episode
Aug 23, 2026
Merged

mapitman merged 1 commit into
mainfrom
fix-auto-advance-skip-blocked-episode

Conversation

@mapitman

Copy link
Copy Markdown
Owner

Summary

  • PlaybackService.playNextQueued() used to give up silently when the queue's front entry couldn't be resolved -- most commonly the mobile-data streaming gate (issue Warn and let the user override at play-time instead of a blanket disable-streaming-on-mobile-data toggle #222) blocking an undownloaded episode with no UI to confirm from in the background, or a dangling queue entry pointing at a deleted FeedItem.
  • That left the player parked on the just-finished episode (STATE_ENDED) and permanently blocked the queue, since the unplayable entry was never moved out of the front slot -- explains the intermittent "doesn't move on to the next episode" symptom, since it depends on whether the next queued episode happens to be downloaded/on Wi-Fi at that moment.
  • Now mirrors onPlayerError's existing handling of a genuinely broken episode: moves the unresolvable entry to the back of the queue (or drops it outright if its FeedItem row is gone) and recurses to try the entry after it, bounded by MAX_ADVANCE_ATTEMPTS so a queue that's entirely unplayable right now can't recurse forever.

Closes #240

Test plan

  • ./gradlew assembleDebug testDebugUnitTest lintDebug
  • No existing tests exercise PlaybackService directly (it's a MediaSessionService wired to a real ExoPlayer) -- not adding new test scaffolding for it here since none of the existing playback tests attempt that and it'd be a larger undertaking than this fix warrants
  • Not verified on-device this session (no device connected); this is background-service logic triggered only when the next queued episode can't be resolved, which isn't really exercisable through the UI without contriving that specific no-Wi-Fi/not-downloaded state anyway

…sue #240)

playNextQueued() used to give up silently if the queue's front entry
couldn't be resolved -- most commonly the mobile-data streaming gate
blocking an undownloaded episode with no UI to confirm from in the
background. That left the player parked on the just-finished episode
and permanently blocked the queue, since the unplayable entry was
never moved out of the front slot.

Mirrors onPlayerError's existing handling of a broken episode: move
the unresolvable entry to the back of the queue and recurse to try
the one after it, bounded by MAX_ADVANCE_ATTEMPTS so an entirely
unplayable queue can't loop forever.
@mapitman
mapitman merged commit cf1a776 into main Aug 23, 2026
1 check passed
@mapitman
mapitman deleted the fix-auto-advance-skip-blocked-episode branch August 23, 2026 03:28
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.

Auto-advance to next Next Up episode silently stops instead of skipping ahead

1 participant