You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(player): offer skip for every marker occurrence - #694
When an episode has two credits ranges, the phone, tablet and TV players offer Skip Credits only in the first one. The apps read only the singular intro, recap and credits fields, and the server fills those with the first occurrence of each kind. The full list is in marker_segments, which the apps never read. Episodes from TheIntroDB (for example Game of Thrones S02E03) have this shape, with a mid-credits scene between the two ranges.
Approach
The shared module now reads marker_segments from each file version in v2 watch detail and from markers_updated. A new MarkerTimeline resolves the ranges, ordered and validated, and falls back to the singular fields when a server sends no segments. It follows the web player's resolveMarkerRegions and markerOccurrenceAtTime. Phone, tablet and TV read it for:
Skip Recap and Skip Credits: shown in every range, each skipping to the end of its own range. The content between two ranges plays.
Skip Intro: the prompt follows the intro that last started. IntroAutoSkipController keys each intro by its own range, so never/ask/always, the countdown and the Always undo work per intro.
Up Next: appears at the start of the last credits range, extended back over credits ranges that run into it. Before, it appeared at the first range and could advance before the mid-credits scene. Episodes with one credits range behave as before.
Downloaded playback gets the same ranges when watch detail is reachable. Downloads carry no markers of their own, as before. Preview skip and the scrubber's marker bands are unchanged. The bands still draw only the first range of each kind.
Validation
Unit tests: new tests for occurrence resolution (active range, the gap between two credits ranges, fallback to the singular fields, unsorted and invalid input, Up Next start), marker_segments parsing in watch detail and markers_updated, the skip target, and a second intro in the intro controller.
testDebugUnitTest across all modules: 6,562 tests, 1 failure. ReflowStyleTest > line height flows from settings fails the same way on unmodified main on the same build host, and this change does not touch the reader.
lintDebug for android-shared, androidApp and androidTvApp passes, and both debug APKs build.
Runtime on emulators against a local server (Game of Thrones S02E03; credits 2975.5–3167.4 s and 3189–3300 s; recap 20–107 s; intro 108–220 s):
Phone, tablet and Pixel Fold (open and folded), Android 16: Skip Credits shows in both ranges. In the first range it lands at 52:47.4, where no control shows during the gap. In the second it ends the episode. On main the second range has no control.
Android TV, Android 14, D-pad only: the same results. OK skips while the controls are hidden. Skip Recap and the focused Skip Intro offer show.
Phone: Skip Recap and Skip Intro (ask) skip to the end of their ranges.
Not exercised at runtime: Always mode, a second intro, Up Next with a next episode (the test library has none after S02E03), downloaded playback, and a markers_updated event. Unit tests cover the logic for each.
Surface and build: before = main at 3627b86 (same code as v1.0.0-beta.27); after = this branch. Phone, tablet and Pixel Fold (open and folded) on Android 16; Android TV 1080p on Android 14.
Risks
Players now prefer marker_segments over the singular fields whenever the server sends them, including an empty list, which means no markers. Older servers that omit the field keep the previous behaviour. On episodes with several credits ranges, Up Next now waits for the last range instead of the first.
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 says there is none.
AI Disclosure
Harness: Claude Code
Tool(s): Claude Code, Codex CLI, adb, Android Emulator
Model(s): claude-opus-5-5, gpt-6.1-sol
Involvement: Fully AI-generated, human verified
Adversarial review: independent reviews of the full diff by claude-opus-5-5 and gpt-6.1-sol (correctness, standards and spec), reconciled. Opus found one real bug, fixed here: entering a second intro could pair the new range with the previous intro's key, which cleared the Always undo right after an auto-skip. The controller now keys each intro by its range. A follow-up review found that scrubbing back before an intro cleared its Always undo; occurrenceAt now returns the first intro before any has started. Both fixes were re-reviewed with no findings. Not changed here: Skip Credits stays hidden while Up Next is showing, as with a single range; intro skip does not run during downloaded playback, which is unchanged from main; and the scrubber bands show only the first range. These are follow-ups, not regressions. Two duplication and data-clump notes were judgement calls and were left as is.
Note
Support skip for every marker occurrence via MarkerTimeline
Adds a new MarkerTimeline model in MarkerTimeline.kt that holds every marker occurrence. It resolves from a new markerSegments list when non-null, and falls back to the legacy singular marker fields when null.
markerSkipTarget now checks the active recap occurrence first, then the active credits occurrence, so each occurrence offers its own end as the skip target. Mobile and TV player overlays use the timeline for manual skips.
Intro auto-skip now observes the intro occurrence at the current position, and the Up Next credits threshold comes from the timeline's last credits occurrence. IntroAutoSkipController keys controller state per intro range under a session-and-file playback key, so a later intro gets its own offer and undo.
FileVersion and PlaybackMarkersUpdate decode a new marker_segments wire field; malformed entries are dropped and an absent field stays null.
Behavioral Change: an explicitly empty markerSegments list means no markers, even if singular marker fields are set. An intro range that ended still anchors the prompt until a later intro starts; check MarkerTimeline.occurrenceAt and upNextCreditsStart for these semantics.
The phone, tablet and TV players read only the singular intro, recap and
credits fields, which the server fills with the first occurrence of each
kind. An episode with two credits ranges showed Skip Credits only in the
first one.
Read marker_segments from v2 watch detail and markers_updated, resolve
them into a MarkerTimeline (falling back to the singular fields when a
server sends none), and drive the recap/credits skip pill, the intro
prompt and the credits-based Up Next from it. Each skip ends at its own
range, so a scene between two credits ranges still plays, and Up Next
waits for the last credits range. The intro prompt keys each intro by
its own range.
ClosesSilo-Server#693
The change adds marker occurrence data to playback models and state, resolves occurrences into a timeline, and updates Android phone, tablet, and TV players to use individual marker ranges for skip controls, intro auto-skip, and Up Next timing.
Changes: Marker occurrences in playback
Layer / File(s)
Summary
Marker segment contract and timeline shared/src/commonMain/.../CatalogModels.kt, shared/src/commonMain/.../PlaybackMarkersUpdate.kt, shared/src/commonMain/.../MarkerTimeline.kt, shared/src/commonTest/...
File versions and playback marker updates now represent marker occurrences. MarkerTimeline resolves and filters ranges, selects active occurrences, and calculates the Up Next credits start. Tests cover decoding, fallback behavior, invalid ranges, and occurrence selection.
Playback starters and ready states now carry marker segments. Player state receives them from playback start, marker reconciliation, realtime updates, replans, and offline playback.
Use occurrences in player behavior android-shared/src/androidMain/.../MarkerSkipTarget.kt, android-shared/src/androidUnitTest/.../MarkerSkipTargetTest.kt, androidApp/src/androidMain/.../PlayerOverlay.kt, androidApp/src/androidMain/.../PlayerViewModel.kt, androidTvApp/src/androidMain/.../TvPlayerScreen.kt, androidTvApp/src/androidMain/.../TvPlayerViewModel.kt, shared/src/commonMain/.../IntroAutoSkipController.kt, shared/src/commonTest/.../IntroAutoSkipControllerTest.kt, androidTvApp/src/androidUnitTest/.../TvWatchPartyPlayerTest.kt
Players use the resolved timeline for marker skip targets, intro occurrences, and credits-based Up Next detection. Tests cover separate credits ranges and later intro ranges.
sequenceDiagram
participant FileVersion
participant MobileVideoPlaybackStarter
participant VideoPlaybackStartResult
participant VideoPlaybackSessionCoordinator
participant PlayerViewModel
participant PlayerOverlay
FileVersion->>MobileVideoPlaybackStarter: selected version markerSegments
MobileVideoPlaybackStarter->>VideoPlaybackStartResult: create Ready with markerSegments
VideoPlaybackStartResult->>VideoPlaybackSessionCoordinator: Ready result
VideoPlaybackSessionCoordinator->>PlayerViewModel: Ready state with markerSegments
PlayerViewModel->>PlayerOverlay: markerTimeline-derived skip target
Loading
Possibly related issues
Silo-Server/silo-android#321: This validation task checks skip-control timing for marker fixtures. The PR changes Android phone and tablet marker range handling, but does not complete the validation.
Silo-Server/silo-android#322: This validation task checks skip-control timing on Android TV. The PR changes TV marker range handling, but does not complete the validation.
The title clearly and concisely describes the main change: enabling skip controls for every marker occurrence.
Description check
The description directly explains the marker occurrence problem, implementation, behavior changes, validation, and risks covered by the changeset.
Linked Issues check
Issue #693 requires Skip Credits in every separate credits range on phone, tablet, and TV. The PR decodes marker_segments, resolves valid occurrences with MarkerTimeline, and uses the active credi…
Out of Scope Changes check
The changes stay within the marker-occurrence scope. Shared parsing, timeline resolution, player wiring, intro and recap occurrence handling, Up Next timing, download propagation, and related tests su…
Docstring Coverage
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Full details: Linked Issues check
Explanation
Issue #693 requires Skip Credits in every separate credits range on phone, tablet, and TV. The PR decodes marker_segments, resolves valid occurrences with MarkerTimeline, and uses the active credits range for the skip target. Tests cover separate credits ranges and the playable gap. The reported emulator checks cover phone, tablet, and TV behavior.
Full details: Out of Scope Changes check
Explanation
The changes stay within the marker-occurrence scope. Shared parsing, timeline resolution, player wiring, intro and recap occurrence handling, Up Next timing, download propagation, and related tests support consistent use of marker_segments. No unrelated product area is evident.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Occurrence identity changes across an automatic skip for overlapping intros [30, 100) and [50, 80): occurrenceAt returns the second range at position 60 but the first at the resulting seek position 80. Both player observers pass this change to IntroAutoSkipController.handle, which clears the second intro's undo and immediately seeks again to 100 in ALWAYS mode instead of preserving undo for the occurrence just skipped.
Prompt for LLM
File shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/MarkerTimeline.kt:
Line 48 to 53:
Occurrence identity changes across an automatic skip for overlapping intros [30, 100) and [50, 80): occurrenceAt returns the second range at position 60 but the first at the resulting seek position 80. Both player observers pass this change to IntroAutoSkipController.handle, which clears the second intro's undo and immediately seeks again to 100 in ALWAYS mode instead of preserving undo for the occurrence just skipped.
The reason will be displayed to describe this comment to others. Learn more.
Checked against the code. Not changing this. Nested intros of the same kind would have to come from one provider for one file. TheIntroDB and local detection don't produce them, and the server keeps a single provider's ranges per kind. Even if they did occur, the sequence described ends in a sensible state: ALWAYS skips [50, 80) and lands at 80, which is inside the enclosing [30, 100), so it skips that too and lands at 100. handle then pins a new Skipped state to [30, 100), so the viewer gets a Watch Intro undo that returns to 30, the start of the intro they actually skipped. Only the inner range's undo goes away, and it is covered by the outer one.
The reason will be displayed to describe this comment to others. Learn more.
Agreed—I withdraw this suggestion. The occurrence identity changes in the hypothetical nested case, but that alone does not establish a bug: the second skip exits the enclosing intro, and the resulting outer-range undo covers the inner range as well.
Given the provider constraints you described and the retained Watch Intro undo, this does not warrant a change in this PR.
Reviewed head: b00b19229 (1af9967 plus a merge of current main).
No defects found. My review of the diff and its callers on phone and TV and a separate adversarial review (gpt-6.1-sol) of 1af9967 both came back clean.
What changed in this review
Merged main into the branch to clear three conflicts in PlayerViewModel.kt, TvPlayerViewModel.kt and CatalogModels.kt. Both sides had added a field or property in the same spot (startedContentId/awaitingFirstFrame and trickplayAvailable from main, the marker fields from this PR), so the merge keeps both. It changes nothing in this PR's behavior.
Validation
On the merged head, both apps compile and all 65 tests in the six affected test classes pass (MarkerTimelineTest, IntroAutoSkipControllerTest, WatchDetailMarkerV2Test, PlaybackMarkersUpdateTest, MarkerSkipTargetTest, TvWatchPartyPlayerTest).
Run against the unfixed code, IntroAutoSkipControllerTest > ask - a later intro under the same key gets its own offer fails as expected (expected Asking(3) but was Hidden). The other new tests use the new MarkerTimeline API, so they don't build without the PR and can't show the fix on their own. The PR's emulator evidence covers the two-credits-range behavior live.
The parsing matches what the server sends: marker_segments is {kind, start_seconds, end_seconds} both in the v2 watch-detail versions and in the markers_updated event. When the event carries a null list, the app falls back to the single-range fields.
Validated features: this unblocks C1 on #321 (Android) and #322 (Android TV). Previously validated cases with one credits range behave as before.
User manual: no change needed. "Watch movies and series" describes the skip settings in general terms, and those still hold.
Left for maintainers: the follow-ups the PR body names (scrubber bands show only the first range of each kind, and there's no intro skip during downloaded playback). Neither is a regression.
Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
Fit: this fixes a gap in core playback, and the phone and TV players now behave like the web player and the Apple apps. It adds no setting and no new surface.
Readiness: the logic is small and well covered. A regression test fails without the fix, and the live before/after captures show the main behavior.
3160-3160: Minor · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Keep Skip Credits available when Up Next opens.
When a next episode is resolved, crossing the last credits start opens Up Next. PlayerOverlay.kt Line 581 then hides Skip Credits until the viewer selects Keep Watching. TV has the same conflict at TvPlayerViewModel.kt Line 3659 and TvPlayerScreen.kt Line 4418. (raw.githubusercontent.com)
Offer Skip Credits on Up Next, or otherwise keep it accessible during the active range.
Review info
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: 0b97f57f-cd0f-4c7c-8553-f845159bcd6e
Commits
Reviewing files that changed from the base of the PR and between 1af9967 and b00b192.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
api-v2API v2 / Huma program (epic silo-server#135)bugSomething isn't workingevidence-requiredNeeds before-and-after evidence before the Evidence check passesimpact: playbackCan't play, stalls, or wrong mediapriority: P2Limited scope, workaround exists, or polishsize/L200–499 added + deleted lines (all files); change volume, not priority.
2 participants
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.
Problem
Closes #693
Related issue: Silo-Server/silo-server#1147
Validation tasks: unblocks #321 C1; #322 C1
When an episode has two credits ranges, the phone, tablet and TV players offer Skip Credits only in the first one. The apps read only the singular
intro,recapandcreditsfields, and the server fills those with the first occurrence of each kind. The full list is inmarker_segments, which the apps never read. Episodes from TheIntroDB (for example Game of Thrones S02E03) have this shape, with a mid-credits scene between the two ranges.Approach
The shared module now reads
marker_segmentsfrom each file version in v2 watch detail and frommarkers_updated. A newMarkerTimelineresolves the ranges, ordered and validated, and falls back to the singular fields when a server sends no segments. It follows the web player'sresolveMarkerRegionsandmarkerOccurrenceAtTime. Phone, tablet and TV read it for:IntroAutoSkipControllerkeys each intro by its own range, so never/ask/always, the countdown and the Always undo work per intro.Downloaded playback gets the same ranges when watch detail is reachable. Downloads carry no markers of their own, as before. Preview skip and the scrubber's marker bands are unchanged. The bands still draw only the first range of each kind.
Validation
marker_segmentsparsing in watch detail andmarkers_updated, the skip target, and a second intro in the intro controller.testDebugUnitTestacross all modules: 6,562 tests, 1 failure.ReflowStyleTest > line height flows from settingsfails the same way on unmodifiedmainon the same build host, and this change does not touch the reader.lintDebugforandroid-shared,androidAppandandroidTvApppasses, and both debug APKs build.mainthe second range has no control.markers_updatedevent. Unit tests cover the logic for each.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-694/
Surface and build: before =
mainat 3627b86 (same code as v1.0.0-beta.27); after = this branch. Phone, tablet and Pixel Fold (open and folded) on Android 16; Android TV 1080p on Android 14.Risks
Players now prefer
marker_segmentsover the singular fields whenever the server sends them, including an empty list, which means no markers. Older servers that omit the field keep the previous behaviour. On episodes with several credits ranges, Up Next now waits for the last range instead of the first.Checklist
AI Disclosure
occurrenceAtnow returns the first intro before any has started. Both fixes were re-reviewed with no findings. Not changed here: Skip Credits stays hidden while Up Next is showing, as with a single range; intro skip does not run during downloaded playback, which is unchanged frommain; and the scrubber bands show only the first range. These are follow-ups, not regressions. Two duplication and data-clump notes were judgement calls and were left as is.Note
Support skip for every marker occurrence via
MarkerTimelineMarkerTimelinemodel in MarkerTimeline.kt that holds every marker occurrence. It resolves from a newmarkerSegmentslist when non-null, and falls back to the legacy singular marker fields when null.markerSkipTargetnow checks the active recap occurrence first, then the active credits occurrence, so each occurrence offers its own end as the skip target. Mobile and TV player overlays use the timeline for manual skips.IntroAutoSkipControllerkeys controller state per intro range under a session-and-file playback key, so a later intro gets its own offer and undo.FileVersionandPlaybackMarkersUpdatedecode a newmarker_segmentswire field; malformed entries are dropped and an absent field stays null.markerSegmentslist means no markers, even if singular marker fields are set. An intro range that ended still anchors the prompt until a later intro starts; checkMarkerTimeline.occurrenceAtandupNextCreditsStartfor these semantics.Macroscope summarized b00b192.