Skip to content

fix(player): offer Skip Credits in every credits range - #915

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/914-marker-occurrences
Oct 27, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/914-marker-occurrences

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #914
Related issue: Silo-Server/silo-server#1147
Validation tasks: unblocks #311 C1; #312 C1

When an episode has more than one credits range, the iPhone, iPad and Apple TV players offer Skip Credits only in the first one. Viewers have to scrub through the second range by hand. Episodes like this come from TheIntroDB for real titles, for example Game of Thrones S02E03. The player read only the singular intro, recap and credits fields. The server fills those with the first occurrence of each kind, and the app never read marker_segments, which lists every occurrence.

Approach

The player now reads marker_segments from v2 watch detail, download manifests (from the server and from the copy saved on the device) and markers_updated events. It keeps every occurrence. The intro, recap and credits ranges the player already tracks now follow the playhead: they hold the occurrence that is playing, else the last one played, else the next one. Skip controls, auto-skip and the intro prompt therefore act on one occurrence at a time. A skip never covers the content between two occurrences, matching docs/markers-api.md and the web player. Responses without marker_segments fall back to the singular fields. With a single occurrence of each kind, behaviour is unchanged.

Two latches now track each occurrence separately. Credits auto-skip remembers every credits range it has skipped, as recap auto-skip already did, so seeking back into skipped credits plays them. After Skip Credits runs to the end of the file, the item counts as finished only while the playhead stays in the final credits range, not in the scene before it.

This covers iOS, iPadOS, tvOS and macOS, streamed and downloaded. The Mac player shows only the intro prompt, so the change reaches it through intro occurrences and credits auto-skip. Preview skip is out of scope. No server or Android change is needed: the server already sends marker_segments, and Android is tracked in Silo-Server/silo-android#693.

Validation

  • Focused XCTest suites on an iOS 26.5 simulator: 11 suites passed (new tests for occurrence lookup, view-model wiring, realtime snapshots, offline manifest round-trip, v2 watch decoding and the per-occurrence latches, plus the existing marker, credits, recap, intro, offline and catalog suites). The full test suite was not run.
  • Builds: iOS and tvOS simulator builds passed; the macOS build passed with signing off (compile only, not run).
  • Local builds used Xcode 26.6 with SWIFT_VERSION=5 on the command line, because the pinned AetherEngine does not compile there in Swift 6 mode. CI builds with Xcode 27.
  • Manual, against a local server on Game of Thrones S02E03 (credits 2975.5–3167.4 s and 3189–3300 s, recap 20–107 s, intro 108–220 s):
    • iPhone 17 Pro and iPad Pro 13-inch: Skip Credits in the first range jumped to 52:47, no control in the gap, Skip Credits again from 53:09, and that skip finished the episode. On main the second range had no control.
    • Apple TV 4K (driven with the remote): same results.
    • Skip Recap still appears in the recap. On iPhone it jumped to the recap's end and the Skip Intro offer appeared. I did not tap Skip Intro: the offer timed out before my automated tap landed. Intro skip modes and countdowns are covered by the existing intro prompt tests.
    • Not exercised manually: Mac playback, downloaded playback, and a live markers_updated event. Unit tests cover the code paths for downloads and realtime events.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/pr-915/

Surface and build: iPhone 17 Pro and iPad Pro 13-inch (M5) simulators on iOS 26.5, and an Apple TV 4K (3rd generation) simulator on tvOS 26.5. Before is main at b514800; after is this branch. iPhone Duo was not captured: it runs the same iOS player controls as iPhone and iPad, and the change only alters when the existing Skip Credits pill appears, not its layout. Mac was not captured. Its player has no Skip Credits control, but it shares the player view model, so a second intro's prompt and credits auto-skip in a later credits range change there too. Unit tests and the SiloMac regression job cover those paths; there is no recording of them.

Risks

Low. The change only alters which range the player tracks when a kind occurs more than once. Older servers that omit marker_segments keep the previous behaviour.

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 (review), AXe, agent-device, xcodebuild, simctl
  • Model(s): claude-opus-5-5 (implementation and review), gpt-6.1-sol (review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: two independent reviewers (claude-opus-5-5 and gpt-6.1-sol) reviewed the full diff for correctness, repository standards and the marker spec. Both found that credits auto-skip kept only the last skipped key, so seeking back into credits already skipped would skip them again. Fixed: it now keeps a set of keys. Opus also found that after skipping the final credits to the end, leaving during the scene between two credits ranges still marked the item finished. Fixed: the check now uses the final credits range. Opus also flagged an unused preview parameter, now removed. A second review of the fixes found no correctness issues. Both reviewers noted that the latch fixes were tested only at the policy level, so the final-credits check moved into a tested helper.

The player read only the singular intro/recap/credits fields, which hold
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, download manifests and
markers_updated events, keep every occurrence, and point the intro,
recap and credits ranges at the occurrence under the playhead. Skips
cover only that occurrence and never the content between two. Responses
without marker_segments fall back to the singular fields.

Closes Silo-Server#914
Credits auto-skip now remembers every credits range it skipped, so
seeking back into credits already skipped plays them. After Skip Credits
reaches the end of the file, the item counts as finished only while the
playhead stays in the final credits range. Drop the unused preview
fallback.
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Oct 26, 2026
@silo-kody

silo-kody Bot commented Oct 26, 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 ❌

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: c6d16f0d-7ab0-44ba-bfbc-4cd2ce3c258e
Commits

Reviewing files that changed from the base of the PR and between b514800 and 13aa032.

Files selected for processing: 14
  • iosApp/Tests/CreditsAutoSkipPolicyTests.swift
  • iosApp/Tests/MarkerReconciliationTests.swift
  • iosApp/Tests/OfflinePlaybackMappingTests.swift
  • iosApp/Tests/PlayerMarkerOccurrenceTests.swift
  • iosApp/Tests/PlayerMarkerTimelineTests.swift
  • iosApp/iosApp/Downloads/DownloadModels.swift
  • iosApp/iosApp/Downloads/OfflinePlayback.swift
  • iosApp/iosApp/Networking/APIv2/APIv2CatalogReadModels.swift
  • iosApp/iosApp/Networking/APIv2/APIv2CatalogReadProjection.swift
  • iosApp/iosApp/Networking/Models.swift
  • iosApp/iosApp/Networking/PlaybackMarkerSegment.swift
  • iosApp/iosApp/Screens/Player/PlaybackRealtimeProtocol.swift
  • iosApp/iosApp/Screens/Player/PlayerMarkerTimeline.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The app now carries multiple marker occurrences through watch, offline, and realtime data. The player resolves the active occurrence at the current playback time, applies marker updates and rollback, and tracks skipped credits occurrences individually.

Changes: Playback marker occurrences

Layer / File(s) Summary
Marker data and payloads
iosApp/iosApp/Networking/PlaybackMarkerSegment.swift, iosApp/iosApp/Networking/Models.swift, iosApp/iosApp/Networking/APIv2/*, iosApp/iosApp/Downloads/DownloadModels.swift, iosApp/iosApp/Downloads/OfflinePlayback.swift, iosApp/iosApp/Screens/Player/PlaybackRealtimeProtocol.swift, iosApp/Tests/OfflinePlaybackMappingTests.swift
File versions and offline manifests carry optional marker segments. Watch projections copy them, offline playback maps them into prepared playback, and realtime payloads decode them or reject malformed arrays.
Occurrence timeline
iosApp/iosApp/Screens/Player/PlayerMarkerTimeline.swift, iosApp/Tests/PlayerMarkerTimelineTests.swift
The timeline filters and orders occurrences, selects active and current ranges, detects final credits, and applies full-timeline or singular marker updates.
Player integration and credits skips
iosApp/iosApp/Screens/Player/PlayerViewModel.swift, iosApp/Tests/PlayerMarkerOccurrenceTests.swift, iosApp/Tests/CreditsAutoSkipPolicyTests.swift, iosApp/Tests/MarkerReconciliationTests.swift
The player resolves ranges from the timeline and updates them during playback, replanning, and realtime reconciliation. Rollback restores the prior timeline. Credits auto-skip tracks skipped occurrence keys in a set.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant PlayerViewModel
  participant PlayerMarkerTimeline
  PlayerViewModel->>PlayerMarkerTimeline: Resolve occurrences at current time
  PlayerMarkerTimeline-->>PlayerViewModel: Return active marker ranges
  PlayerViewModel->>PlayerViewModel: Update intro, recap, and credits windows
Loading

Possibly related issues

  • Issue 311 covers iOS marker skip controls, including marker occurrence behavior changed here.
  • Issue 312 covers tvOS marker skip controls; this change updates shared player marker logic.

Suggested labels: bug, api-v2, impact: playback, evidence-required, priority: P2, size/XL

Suggested reviewers: quick104

Merge Risk: Minimal · up to 13aa0

No actionable issue is established from the available evidence; the change is mergeable after normal checks.

Security architecture risk: Low · up to 13aa0

The change uses existing playback paths and preserves the inspected session and file checks. No introduced security failure was established. Server-side authorization and interrupted playback recovery were not verified end to end.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Within the inspected client paths, occurrence metadata affects the selected playback item's skip and completion behavior. Realtime influence remains constrained to the current owner, socket binding, session, and selected file; this does not establish the security of server-side marker publication.

Trust Boundaries and Controls

  • observed — Realtime binding requires committed session authority. Event delivery checks the current owner, binding generation, and envelope session; marker application additionally checks the active session, any payload session, and selected file before changing the timeline.
  • observed — A malformed realtime collection shape or entry rejects the marker payload rather than applying a partial snapshot. Reconciliation responses must still match the request identity, playback session, and selected file before being applied.

Resilience and Maintainability Implications

  • observed — Automatic credits skips remain disabled during loading and Watch Party playback. Replan initiation sets the loading state before candidate adoption, providing counterevidence against immediate automatic skip side effects during that transition.
Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 13 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(player): offer Skip Credits in every credits range" matches the main change. The PR makes the player read every credits occurrence from marker_segments, so Skip Credits appears in each …
Linked Issues check Passed Issue #914 has one active direct link and one coding requirement. Skip Credits must appear in each credits range, skip only to that range's end, and leave the gap between ranges playable. The reviewed…
Out of Scope Changes check Passed Every changed area supports the marker-occurrence objective of #914. The changes are: the new PlaybackMarkerSegment type; the markerSegments fields in FileVersion, WatchFileVersion and OfflineManifest…
Description check Passed The pull request description directly explains the changes to support multiple marker occurrences, per-occurrence credits skipping, offline manifests, realtime updates, fallback behavior, validation, …
Full details: Title check

Explanation

The title "fix(player): offer Skip Credits in every credits range" matches the main change. The PR makes the player read every credits occurrence from marker_segments, so Skip Credits appears in each range, not only the first. The changeset covers the timeline model, the view model wiring, the realtime and download parsing, and the per-occurrence auto-skip latch. The title is specific and uses a conventional type and scope. It omits the parsing and offline details, which is acceptable.

Full details: Linked Issues check

Explanation

Issue #914 has one active direct link and one coding requirement. Skip Credits must appear in each credits range, skip only to that range's end, and leave the gap between ranges playable. The reviewed head meets this. PlayerMarkerTimeline.swift keeps every valid marker occurrence from marker_segments in source-time order. currentOccurrence(_:at:) selects the active occurrence. In a gap, it selects the last played occurrence, else the next one, so a skip ends at that range's end and does not cover the gap. Models.swift, APIv2CatalogReadModels.swift, DownloadModels.swift, OfflinePlayback.swift and PlaybackRealtimeProtocol.swift read and carry marker_segments from v2 watch detail, download manifests and markers_updated events. PlayerViewModel.swift uses the timeline for skip controls and auto-skip. Responses without marker_segments fall back to the singular fields. Credits auto-skip records every skipped key, so seeking back into skipped credits plays them. The PR reports manual checks on iPhone, iPad and Apple TV for Game of Thrones S02E03 (two credits ranges). Those checks showed Skip Credits in both ranges and no control in the gap. New XCTest suites cover occurrence lookup, gap handling, the v2 decoding path, the offline manifest round trip and realtime snapshots. Mac playback, downloaded playback and a live markers_updated event were not tested manually. Their code paths are present and covered by unit tests, so no requirement is unmet. Preview skip is not part of #914.

Full details: Out of Scope Changes check

Explanation

Every changed area supports the marker-occurrence objective of #914. The changes are: the new PlaybackMarkerSegment type; the markerSegments fields in FileVersion, WatchFileVersion and OfflineManifest; the offline mapping that copies manifest.markerSegments; the realtime markers_updated decoding, including the removal of PlaybackRealtimeMarkerRangeUpdate.resolving(current:), which the timeline replaces; PlayerMarkerTimeline; the PlayerViewModel wiring; and tests for these paths. The removal of resolving(current:) is a supporting refactor for the new timeline. The PR does not change preview skip, which the PR description and the linked issue do not require. The reviewed head contains no unrelated change in the reviewed summary or in the inspected timeline file.

Full details: Description check

Explanation

The pull request description directly explains the changes to support multiple marker occurrences, per-occurrence credits skipping, offline manifests, realtime updates, fallback behavior, validation, and scope. It is clearly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 13 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working priority: P2 Limited scope, workaround exists, or polish labels Oct 26, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026

Copy link
Copy Markdown

Visible change; evidence is incomplete.

  • Repeated credits/recap ranges change when the Skip control appears and where it seeks; the iPhone Duo is missing in both folded and open modes. Add a recording in each mode showing a later credits range and the gap between ranges.
  • Repeated intro ranges and credits auto-skip also change playback on Mac; it is missing from the evidence. The shared PlayerViewModel and PlayerMarkerTimeline drive the intro-skip pill in MacPlayerScreen and credits auto-skip, so the absence of a Skip Credits button does not exclude Mac. Add a Mac recording showing the affected behavior.

Suggested fix (no diff): publish these recordings on the evidence page and update the Evidence section to identify the Mac and both Duo states.

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

Posted via Macroscope — Visible change evidence

@coderabbitai coderabbitai Bot added api-v2 API v2 / Huma program (epic silo-server#135) evidence-required Needs before-and-after evidence before the Evidence check passes impact: playback Can't play, stalls, or wrong media labels Oct 26, 2026
@Rhainland

Copy link
Copy Markdown
Contributor Author

Mac: right, the Evidence section contradicted the summary. It now says the Mac is reached through the shared view model (a second intro's prompt and credits auto-skip) and that those paths have unit-test and SiloMac regression coverage but no recording. iPhone Duo: no change. It uses the same iOS player controls captured on iPhone and iPad, and this change affects only when the existing pill appears, not its layout in either fold state.

@Quick104
Quick104 merged commit 004e381 into Silo-Server:main Oct 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 API v2 / Huma program (epic silo-server#135) bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Skip Credits is missing in an episode's second credits range

2 participants