Skip to content

feat(player): let viewers turn Next Up off - #995

Open
Rhainland wants to merge 4 commits into
Silo-Server:mainfrom
Rhainland:feat/next-up-off
Open

Rhainland wants to merge 4 commits into
Silo-Server:mainfrom
Rhainland:feat/next-up-off

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server Discussion #4443
Validation tasks: changes #347 C9, #348 C9 (Next Up; not run yet)

Other clients: Apple Silo-Server/silo-apple#1219; Roku Silo-Server/silo-roku#97; Web Silo-Server/silo-server#4503

Depends on #994 (Up Next from the end of the file) and Silo-Server/silo-server#4501 (the setting). Until #994 merges this branch carries its two commits; the change here is the last commit.

Viewers cannot turn Up Next off on Android. Auto-Play Next Episode only stops the countdown; the card still opens before or at the end of every episode.

Show Next Up on the phone and TV now offers Off. With Off, the player opens no Up Next card before or at the end and starts no next episode; when playback ends it closes the way Back does. A shuffle still moves on, since the viewer asked for one.

Approach

  • Off writes playback.next_up_enabled false (settings revision 30, feat(settings): add a setting that turns Next Up off silo-server#4501) and leaves the stored seconds alone; choosing a time turns Next Up back on. One picker owns both keys, so Use profile setting clears both together.
  • The key is detected from the server's settings manifest, like the buffering quality mode. A server without it is never sent it: Off is hidden and Next Up stays on. A write made before the manifest is read is kept and sent again after the first refresh.
  • On the TV, an Up Next overlay the viewer opened by hand stays up at the end, without a countdown.
  • The bindings and the vendored settings manifest move to revision 30. Their SOURCE note names the unmerged server commit and needs re-pointing once feat(settings): add a setting that turns Next Up off silo-server#4501 merges.

Validation

  • ./gradlew testDebugUnitTest: shared 2,510, android-shared 2,314 and Android TV 1,407 tests pass. On the phone module, 1,012 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.
  • Lint (lintDebug for all three modules, lintVitalRelease for both apps) passes with no new findings. Both apps build with assembleDebug. Supply-chain checks pass.
  • On an emulator against a local server on the contract branch: the phone and TV pickers offer Off, and choosing it is stored as this device's value (the TV then shows the profile's 30 seconds).
  • Not captured: playback reaching the end with Off on a device; the player decision is covered by the view model tests.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/pr-995/

Phone and TV Settings → Playback → Show Next Up, from this branch. Before, the same picker had no Off. Phone, tablet and foldable share the phone settings layout.

Risks

None beyond the SOURCE re-point above.

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 the discussion's request, repeated on later cleanup; the real findings were fixed before opening

Note

Add setting to let viewers turn Next Up off on phone and TV players

  • Adds a NextUpEnabled setting key with manifest detection. Servers that do not support the key still show Next Up enabled; the stored Off value is kept and applies once support appears (PlaybackSettingsKeys.kt, AndroidPlayerSettingsStore.kt).
  • Settings screens on both apps offer an Off option through the shared NextUpChoice model, shown only when the server supports the key or Off is already selected.
  • Replaces the credits-marker Up Next trigger with NextUpPrompt.crossesPromptPoint, which fires at the configured seconds before file end (NextUpPrompt.kt).
  • With Next Up off, the players do not auto-show the Up Next card and close playback at video end.
  • Risk: Up Next timing changes for all viewers — the card now opens at prompt seconds before end instead of at credits markers; the TV default prompt timing moves from 10 to 30 seconds, and the settings contract revision rises from 28 to 30.

Macroscope summarized fa22e02.

…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.
Viewers who would rather go back to the series at the end of an episode
cannot turn the Next Up card off; Auto-play Next only stops its countdown.

The Show Next Up picker on phone and TV now offers Off first. It writes
playback.next_up_enabled (settings revision 30), and choosing a time turns
Next Up back on. With Off the player opens no card before or at the end and
closes the way Back does when playback ends; a shuffle still moves on. One
control owns both Next Up keys, so Use profile setting clears them together.

A server whose settings manifest lacks the key is never sent it: the picker
hides Off and Next Up stays on there, as with the buffering quality mode.
The settings bindings and the vendored manifest move to revision 30.
@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 1 minute.

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: 86a8510a-389b-46c3-8fdd-2b4ac39d49f6
Commits

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

Files selected for processing: 24

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/AndroidPlayerSettingsStore.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/NextUpChoice.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/PlayerSettingsStore.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/settings/AndroidPlayerSettingsStoreTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/settings/NextUpChoiceTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/PlaybackSettings.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsPages.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsViewModel.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/TvSettingsScreen.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/commonMain/kotlin/org/siloserver/silo/model/settings/PlaybackSettingsKeys.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/settings/SettingKeys.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/domain/player/MarkerTimelineTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/domain/player/NextUpPromptTest.kt
  • shared/src/commonTest/resources/settings/v1/SOURCE
  • shared/src/commonTest/resources/settings/v1/conformance.json
  • shared/src/commonTest/resources/settings/v1/manifest.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Nov 18, 2026
@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

Visible changes lack reviewable evidence: Evidence: EVIDENCE_LINK is a placeholder, not an evidence URL or attached capture.

  • The Show Next Up picker adds Off (PlaybackSettings.kt, TvSettingsScreen.kt) on Android phone, tablet, foldable folded and open, and Android TV. No before/after captures are attached; provide same-screen pairs for each device configuration.
  • Turning Next Up off suppresses the card and automatic next episode, then exits at playback end (PlayerViewModel.kt, TvPlayerViewModel.kt) on phone, tablet, foldable folded and open, and TV. The PR says this was not captured; provide recordings of the end-of-playback behavior on each.
  • On TV, a manually opened Up Next overlay remains at the end without a countdown (TvPlayerViewModel.kt). No recording shows this; include it in the TV playback capture.

Name the device and build or commit for each capture. The reported emulator check and view-model tests do not show these visible changes. Suggested fix: replace the placeholder with the required screenshots and recordings, or attach them under Evidence.

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

Posted via Macroscope — Visible change evidence

Comment on lines +32 to +33
if (!currentlyEnabled) store.setNextUpEnabled(true)
store.setNextUpPromptSeconds(choice)

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 high

Timing choices do not override an inherited enabled setting

A later profile change to Off disables Next Up despite the device's explicit timing choice. Call store.setNextUpEnabled(true) whenever a timing choice is selected.

Prompt for LLM
File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/NextUpChoice.kt, lines 32-33:

Timing choices do not override an inherited enabled setting

Selecting a timing while the inherited profile value is enabled writes only the timing override, so a later profile change to Off disables Next Up despite the device's explicit timing choice. Write an enabled device override whenever a timing choice is selected.

Suggested code:

store.setNextUpEnabled(true)
store.setNextUpPromptSeconds(choice)

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.

Fixed in fa22e02. Where the server stores Off, choosing a time now writes next_up_enabled = true as well as the seconds, so the picker's choice is this device's whole choice. On a server without the key only a saved Off is turned back on, so the key is still never sent there. NextUpChoiceTest covers the writes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the update. Writing both values when the server supports the setting addresses the inherited-setting concern, while preserving compatibility with older servers. The added NextUpChoiceTest coverage is helpful.

I haven’t independently verified the commit or run the tests.

Comment on lines +5422 to +5424
if (videoEnded) {
if (_uiState.value.showNextUp) {
_uiState.update { it.copy(nextUpVideoEnded = true) }

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 high

Disabling Next Up leaves an active TV countdown running

An existing countdown can advance to the next episode after Next Up is disabled. Cancel nextUpCountdownJob and clear nextUpCountdownSeconds when handling the disabled setting.

Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt, lines 5422-5424:

Disabling Next Up leaves an active TV countdown running

If Next Up is disabled after the automatic overlay has opened, the end event marks the overlay ended without canceling its existing countdown, which then automatically advances to the next episode. Cancel the countdown and clear its displayed value when handling the disabled setting.

Suggested code:

if (_uiState.value.showNextUp) {
    nextUpCountdownJob?.cancel()
    nextUpCountdownJob = null
    _uiState.update { it.copy(nextUpVideoEnded = true, nextUpCountdownSeconds = null) }
}

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.

Not realistic: the overlay covers the TV screen while it counts down, so the viewer cannot reach Settings, and the setting is read when playback starts. Only a background settings refresh landing in that last minute or two could flip it. The branch exists for the overlay the viewer opened by hand, which has no countdown. Leaving it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood. The countdown scenario depends on a background settings refresh during a narrow window, while the intended manual-overlay case has no countdown. Given that tradeoff, leaving the code as-is is reasonable.

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 files never trigger their before-end Next Up prompt

When the lead time is at least the file duration, playback cannot cross promptStart, so the card appears only at the end. Handle the initial playback sample when promptStart is at or before zero.

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

Short files never trigger their before-end Next Up prompt

When the configured lead time is at least the file duration, the prompt point is zero or negative and playback starting at zero can never cross it, so the card appears only at the end instead of before it. Handle the initial playback sample when the computed prompt point is at or before zero.

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.

Duplicate of the finding on #994 at the same line: a file no longer than the lead time gets Up Next when playback ends, as on main.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Understood. This duplicates the finding on #994 and describes existing behavior on main: when a file is no longer than the configured lead time, Up Next appears at the end. It is not a new regression introduced by #995.

@silo-triage silo-triage Bot added enhancement New feature or request needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish stacked Stacked on another open PR or branch labels Nov 18, 2026
Choosing a time wrote only the seconds while Next Up was already on, so
next_up_enabled stayed inherited from the profile. Turning Next Up off for
the profile elsewhere then turned it off on this device too, although its
picker showed a choice of its own. Where the server stores Off, a time now
writes both keys.
@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 ❌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority. stacked Stacked on another open PR or branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant