Skip to content

fix(player): time Up Next from the end of the file, not the credits marker - #994

Open
Rhainland wants to merge 2 commits into
Silo-Server:mainfrom
Rhainland:fix/next-up-from-file-end
Open

Rhainland wants to merge 2 commits into
Silo-Server:mainfrom
Rhainland:fix/next-up-from-file-end

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #910
Related issue: Silo-Server/silo-server Discussion #4443; #927 (likely fixed, not re-tested)
Validation tasks: changes #347 C9, #348 C9 (Next Up timing; not run yet); may change #321 C1, #322 C1 (#927, see below)

Other clients: Apple N/A (already times Next Up from the end of the file); Roku N/A (already does); Web Silo-Server/silo-server#4502

The Show Next Up setting offers "At end" and "N seconds before end", but on an episode with a credits marker, both the phone and the TV opened Up Next when the credits started, whatever was chosen (#910). The TV player never read the setting at all. The Apple apps and Roku open Up Next from the chosen number of seconds before the end of the file.

Both Android players now open Up Next when playback crosses the chosen number of seconds before the end of the file, and for "At end" only when playback ends.

Approach

  • NextUpPrompt.crossesPromptPoint (shared) decides the moment: forward playback crossing playback.next_up_prompt_seconds before the file's duration. A resume or seek past that point waits for the end, so reopening an episode near its end does not throw up the card at once. The phone and TV view models both use it.
  • Credits markers drive only Skip Credits now. Skipping credits that run to the end of the file ends playback, which opens Up Next.
  • The TV still records the closing-credits crossing on its own, so leaving during the credits keeps returning the series page to the next episode, as before. The Up Next point counts toward that only when the stream has ended.
  • The TV settings screen now assumes the same 30-second default as the settings store and the server.

#927 (credits followed by a preview open the end screen instead of Skip Credits) came from opening Up Next at the credits start, so it is probably fixed too. It has not been re-tested on that fixture, so it stays open.

Validation

  • ./gradlew testDebugUnitTest on this branch: shared 2,510, android-shared 2,312 and Android TV 1,407 tests pass. On the phone module, 1,011 tests ran and three FormattersTest cases failed; they compare decimal output ("1.0") under the build machine's locale and touch nothing in this change. :androidApp:assembleDebug and :androidTvApp:assembleDebug build.
  • Lint (lintDebug for all three modules, lintVitalRelease for both apps) passes with no new findings, run on the stacked Off branch that contains this change.
  • Supply-chain checks pass.
  • Not captured: a recording of Up Next opening on a device; the timing is covered by the new unit tests.

Evidence

No screen changes: Up Next looks the same and opens at a different time. How it was checked, on this branch:

NextUpPromptTest: opens when playback crosses N seconds before the end; already past
the point does not reopen; At end and an unknown duration never open early
shared 2510 tests, android-shared 2312, androidTvApp 1407: 0 failures
androidApp 1011: 3 FormattersTest failures (locale decimal separator, not touched here)

Risks

Viewers who relied on Up Next opening at the credits start now see it at their Show Next Up time (30 seconds before the end by default).

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code, running in T3 Code
  • Tool(s): Claude Code, GitHub CLI, Codex CLI (review only)
  • Model(s): claude-opus-5-5; reviewers gpt-6.2-sol, gpt-6.2-astra, claude-fable-5-2
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: four independent reviews (gpt-6.2-sol, gpt-6.2-astra, claude-opus-5-5, claude-fable-5-2) of the branch diff for correctness, repository standards and [bug] "Next Up" timing choices appear at the same time and rely on credit markers, not file end #910; the real findings were fixed before opening (the TV series-page return point that moved with Up Next)

…arker

The Show Next Up setting offers "At end" and "N seconds before end", but on
an episode with a credits marker both apps opened the card at the credits
start whatever was chosen. The TV player never read the setting at all.

Both players now open Up Next when playback crosses the chosen number of
seconds before the end of the file, and only when the stream ends for "At
end", as the iOS and tvOS player already does. Credits markers still drive
Skip Credits; skipping credits that run to the end ends the stream, which
opens the card. The TV settings screen now assumes the same 30-second
default as the settings store and the server.

Fixes Silo-Server#910
…credits

Moving Up Next to the end of the file also moved the point at which the TV
player treats an episode as finished for the series page. Leaving during
the closing credits then opened the series on the episode just watched,
and leaving after an early prompt during the final scene opened it on the
next one.

Record the closing-credits crossing on its own again, and count the Up
Next prompt only when the stream has ended. Update the comments that still
described the credits-based trigger.
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3bac8153-bc37-4e61-97a4-9a4a22fde7b4
Commits

Reviewing files that changed from the base of the PR and between bb59172 and 445ca87.

Files selected for processing: 9

  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelLoadOwnershipIntegrationTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/settings/TvSettingsViewModel.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/MarkerTimeline.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/NextUpPrompt.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/domain/player/MarkerTimelineTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/domain/player/NextUpPromptTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 18, 2026

Copy link
Copy Markdown

Up Next now opens at the configured point before the file ends instead of at the credits marker (PlayerViewModel.kt, TvPlayerViewModel.kt, and NextUpPrompt.kt), reaching the Android phone, tablet, foldable (folded and open), and Android TV. The Evidence section says no device recording was captured; add recordings demonstrating the timing on each device/state, labeled with device and build or commit. Unit tests do not show this user-visible playback timing.

Suggested fix: Attach the recordings under Evidence, or publish them on evidence.siloserver.org and link the evidence page.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

Comment on lines +22 to +23
val promptStart = duration - promptSeconds
return previousPosition < promptStart && position >= promptStart

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

Short episodes never cross the configured Up Next prompt point

Episodes at or below the configured offset end without showing Up Next because promptStart is nonpositive and playback starts at zero. Handle this boundary explicitly so the prompt can appear during playback.

Prompt for LLM
File shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/NextUpPrompt.kt, lines 22-23:

Short episodes never cross the configured Up Next prompt point

A file whose duration is less than or equal to the configured offset never shows Up Next before ending because its prompt point is nonpositive and playback positions start at zero. Handle this boundary explicitly so short episodes can surface the prompt during playback.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as main. The phone already computed the point as duration minus the lead time and needed a forward crossing, so a file no longer than the lead never opened the card early; the TV never used the setting at all. Such a file still gets Up Next when the stream ends (onApproachingEnd(videoEnded = true)). The longest lead is 2 minutes, so this only affects clips, not episodes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That context changes the assessment: short files still get Up Next when playback ends, so the suggestion overstates the impact. The phone’s behavior is also unchanged from main; the TV’s prior behavior was different because it did not use the setting.

There is still a boundary case: for a file no longer than the configured lead time, the prompt cannot open early under the crossing logic. Whether to change that is a product decision rather than necessarily a regression in this PR. I would not treat it as blocking #994.

@silo-triage silo-triage Bot added bug Something isn't working needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] "Next Up" timing choices appear at the same time and rely on credit markers, not file end

1 participant