fix(player): hold next-episode prompt until playback ends when post-credits content exists#1325
Open
anikettuli wants to merge 2 commits into
Open
Conversation
…redits content exists When an outro skip interval exists, the next-episode card fired at outroInterval.startTime. With auto-play next episode enabled this advances to the next episode during the credits, skipping any post-credits scene that lives between the outro end and the episode's actual end. Deferring the trigger to the outro end is not enough: the post-credits scene starts at the outro end, so a card firing there still cuts the scene off after the 3-second auto-play countdown. Instead, when the gap between the outro end and the episode duration is at least 30 seconds (a post-credits tail rather than trailing logos/silence), the outro-based trigger is suppressed entirely and the existing playback-ended handler shows the card at the true end of the episode — matching the reported expectation that the prompt holds until the episode truly ends. Episodes whose outro runs to (or nearly to) the end keep the fire-at-outro-start behavior unchanged. New unit test PlayerNextEpisodeRulesTest: - asserts outro with no post-credits content still fires at outro start - asserts a 70s post-credits tail suppresses the card during the outro, at outro end, and mid post-credits scene - asserts a tail under the 30s threshold keeps outro-start behavior - asserts unknown duration falls back to outro-start behavior Fixes NuvioMedia#1305 Note: NuvioMedia#1301 (autoplay ignoring binge group) was already addressed by the StreamsRepository rewrite that threads persistedBingeGroup and bingeGroupOnly through every selector call site, so this PR scopes down to the post-credits fix only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the “Next Episode” card trigger logic to account for outros and potential post-credits content, and adds tests for these scenarios.
Changes:
- Adds a post-credits “tail” detection threshold and adjusts outro-based triggering logic.
- Introduces common tests covering outro/no-outro and duration-known/unknown cases.
- Adds a constant for the post-credits threshold (30s).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| composeApp/src/commonMain/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRules.kt | Implements post-credits tail detection and adjusts when the next-episode card can appear. |
| composeApp/src/commonTest/kotlin/com/nuvio/app/features/player/skip/PlayerNextEpisodeRulesTest.kt | Adds tests validating next-episode card behavior with outros, post-credits tails, and unknown duration. |
…-credits episodes Relying solely on the playback-ended handler left the rules function returning false for the whole episode, and streams whose duration metadata overshoots the actual content never fire a clean ended event. The card now appears once playback enters the last five seconds of the episode, so the post-credits scene still plays out and the prompt cannot be lost when ended never fires. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an outro skip interval exists for the current episode, the next-episode card fired as soon as playback reached
outroInterval.startTime. With auto-play next episode enabled this advances to the next episode during the credits, skipping any post-credits scene that lives between the outro end and the episode's actual end.PR type
Why
PlayerNextEpisodeRules.shouldShowNextEpisodeCardhard-coded the trigger at outro start whenever an outro interval exists. A naive fix of deferring the trigger to the outro end is not enough — the post-credits scene starts at the outro end, so a card firing there still cuts the scene off after the 3-second auto-play countdown.Instead, when the gap between the outro end and the episode duration is at least 30 seconds (a post-credits tail rather than trailing logos/silence), the outro-based trigger is suppressed entirely and the existing playback-ended handler in
PlayerScreenRuntimeEffectsshows the card at the true end of the episode — matching the issue's expectation that the prompt holds until the episode truly ends. Episodes whose outro runs to (or nearly to) the end keep the fire-at-outro-start behavior unchanged, as do episodes with no outro data (threshold modes untouched) and episodes with unknown duration.The 30-second tail threshold is a judgment call — happy to tune it or make the post-credits hold a setting if preferred.
Issue or approval
Fixes #1305
UI / behavior impact
Policy check
CONTRIBUTING.md.Scope boundaries
Testing
./gradlew :composeApp:compileFullDebugKotlinAndroidpasses clean../gradlew :composeApp:testFullDebugUnitTestpasses.New unit test
PlayerNextEpisodeRulesTest:Manual (please verify during review — needs a device):
Screenshots / Video (UI changes only)
Not a UI change.
Breaking changes
None.
Linked issues
Fixes #1305