Skip to content

feat(playback): mark an item watched when playback reaches its end credits - #5133

Merged
Quick104 merged 11 commits into
mainfrom
feat/watched-at-credits
Nov 23, 2026
Merged

Quick104 merged 11 commits into
mainfrom
feat/watched-at-credits

Conversation

@Quick104

@Quick104 Quick104 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

Other clients: Apple Silo-Server/silo-apple#1255 (offline progress and the series-return check still use a local 90%); Android Silo-Server/silo-android#1037 (offline progress); Roku N/A (no downloads; the server decides watched state for streaming)

Viewers often stop a movie or episode once the end credits start. With the default "Mark watched at" of 90%, a title with more than a few minutes of credits stays in Continue Watching, isn't marked watched, and Next Up doesn't move on. Admins work around it by lowering the percentage, which also marks titles without long credits watched too early. Silo usually knows where the credits start, from local credit detection, a manual marker, or a marker provider, so it can use that instead.

When the played file has a stored credits marker inside its end-credits window, reaching it now marks the title watched, whichever comes first of the credits and the percentage. There is no new setting. Web admin explains the rule under "Mark watched at".

Approach

userstore.ProgressThresholds gains the played file's credits start, and its new Watched method is now the single rule for "this position finishes the item". ResolveProgressState and every inline copy of the percentage check use it: native progress and stop, realtime stops, admin playback history, watch history rows, multi-episode span marking, notification interest tracking, and Jellyfin-compatible progress and scrobbles. Completion is decided before the min-resume floor, so credits that start under a raised floor still finish the play.

The credits come from the file the session streams, on the same timeline as the duration: the file row native playback already loads, or the played version on the Jellyfin path. Only credits starting in the end-credits window count (markers.CreditsLimits.EndCreditsStart, using the existing placement limits), so a misplaced legacy marker can't finish an item early. Both use the item kind's window. On the Jellyfin path, PlaybackInfo resolves each source's end-credits start, from every credits occurrence and with the item's kind, and stores that value on the source, so a play session reloaded from the durable store keeps it. Progress reports and stop scrobbles use credits only from a version the play identifies, not from the first listed one they fall back to.

A finished stop now reaches watch-sync providers as a play to the end. Silo decides completion, while Trakt infers it from progress at 80%, so without this a credits stop at 76% would be watched in Silo and paused on Trakt.

Not covered, and kept on the percentage rule:

  • Offline downloads and /sync/progress writes: they carry the item but not the file that played.
  • Provider markers under "on demand" online-marker storage: these are never stored. The default "stored" mode saves them when playback starts.
  • Sessions that stream another file than the one requested, such as a lower-bitrate version or the next part of a multipart title, and Jellyfin stops whose played version was never identified.

Validation

  • Live, native playback: on a Silo dev sandbox, an episode with stored credits was played through the v3 API and stopped inside its credits at 85%. On origin/main the progress and history rows stay unfinished. On this branch both are finished and the resume point is cleared. A control episode without credits, stopped at the same 85%, stays unfinished.
  • Live, web admin: the Playback settings page shows the new help line at desktop, tablet, and phone widths.
  • Tests: tests for the native stop, the Jellyfin progress report, and the watch-sync stop event fail on origin/main and pass here; the native stop test also covers a session streaming a substituted version. A table test of ResolveProgressState covers credits under a raised floor and credits at the end of the file, and a test of the Jellyfin source build covers the item kind's window and the last credits occurrence. The touched Go packages, the admin settings web tests, tsc, and make lint-changed pass.
  • Not run live: the Jellyfin-compatible path and a real Trakt or MDBList account. Those are covered by the tests above.

Evidence: https://evidence.siloserver.org/r/silo-server/watched-at-credits/

Risks

  • Behavior change for everyone, with no opt-out: a title with a stored credits marker is marked watched once playback reaches the credits, even when an admin set "Mark watched at" to 100%. A viewer who stops during the credits before a post-credits scene finds the title watched with no resume point, as already happens past 90%.
  • Credits mismatched to the file: if the stored credits are wrong for the file, the title finishes early. Placement limits keep that within the file's end window.
  • Jellyfin play sessions started before this deploy: they have no stored end-credits value and keep the percentage rule until the next play.

Follow-ups

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

Plan round (before implementing): Sol, Opus, and Gemini at medium. Opus's cut removed a per-session copy of on-demand provider credits in favor of the stored marker. Sol's and Gemini's checks added completion before the min-resume floor, credits from the same file as the duration, and the played version's stored credits on the Jellyfin path.

Background review: 3 rounds, last reviewed 65fb066.

Member Round 1 (24d4e81) Round 2 (3f8f3f3) Round 3 (65fb066)
Sol (gpt-6.2-sol, medium) 7/10 (findings returned, not posted) 8/10 (findings returned, not posted) 8/10
Opus (claude-opus-5-5, medium) 8/10 8/10, no findings 8/10
Gemini (gemini-4-neon, medium) 9/10, no findings 9.5/10, no findings 8.5/10

Visual review: 1 round, captures from 24d4e81

Member Round 1
Sol better, 9/10
Opus better, 8/10
Gemini better, 10/10

Fixed: the Jellyfin path stores each source's end-credits start with the item's kind and every credits occurrence (Opus's window finding, Sol's and a bot's reload finding); a stop scrobbled for a reaped session names its file only from an identified source (bot, 4be60ca); native paths count credits only from the file the session streams (bots, 65fb066); a detached Jellyfin stop that never identified its version keeps its guess out of the streamed file, so neither its scrobble nor its history applies credits (round 3, all three members, and a bot, 672a89c); sessions on a longer timeline skip credits (bot, 811d223). Answered: a report naming a different cut than the one streaming, idle cleanup sending a finished stop before a late client stop, a marker edited mid-play, a substituted version's own credits, and Jellyfin plays negotiated before the deploy follow paths that already behaved this way past the percentage, so they're unchanged. The visual review's wording suggestions (say "skip marker", say "marked watched") were kept as is, since "credits marker" is the term web admin already uses for these markers, and the line already says the credits also count.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; Codex CLI and Antigravity for the council reviewers
  • Model(s): claude-opus-5-5 (implementation, code review); claude-sonnet-5-5 (code-review cleanup finder and validation check); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (council)
  • Involvement: Fully AI-generated; not yet verified by a person
  • Adversarial review: a plan round, a high-level code review that changed the Jellyfin version handling, the credits window, and watch-sync reporting, a simplify pass, and the council review above.

🤖 Generated with Claude Code

Note

Mark playback items as watched when reaching end credits

  • Adds end-credits completion to watch-state resolution: ProgressThresholds gains a credits-start position and a shared Watched predicate, and CreditsLimits.EndCreditsStart computes the eligible marker position from the file's tail window (internal/userstore/threshold.go, internal/markers/credits_placement.go)
  • Native playback progress, stops, realtime stops, and admin history use file-aware thresholds via the new PlaybackHandler.playbackThresholdsForFile, which only applies credits completion when the streamed file and timeline are identified
  • Jellyfin compatibility sources carry a computed end-credits start; progress reports, scrobbles, and stops complete at credits only when the played version is identified, while fallback/guessed sources keep percentage-only completion (internal/jellycompat/)
  • Completed stops below the minimum-resume floor are no longer discarded when they are at credits (ResolveProgressState), and completed stop events are sent to plugin providers as a play at 100% of the duration
  • Updates admin/Jellyfin/markers API docs, adds a watched-threshold description in playback settings, and refreshes generated locales
  • Risk: ResolveProgressState in internal/userstore/threshold.go now checks the watched predicate before the minimum-resume floor, so stops previously skipped as below-floor may now count as completed when credits markers exist

Macroscope summarized 672a89c.

Quick104 and others added 3 commits November 22, 2026 21:04
…edits

A title whose end credits run past the remaining 10% stayed in Continue
Watching when the viewer stopped once the credits began. When the played
file has a stored credits marker in its end-credits window, reaching it now
finishes the item, whichever comes first of the credits and the watched
threshold. Native playback, realtime stops, admin and watch history,
notifications, and Jellyfin-compatible reports share the one rule, which
also decides completion before the min-resume floor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… finished stops in full

Address review of the credits rule:

- Use the item kind's credits window where it is known (native playback),
  and either kind's on the Jellyfin path, which doesn't record it.
- On the Jellyfin path, count credits only from a version the play
  identifies, not the first listed one guessed when nothing does.
- Report a finished stop to watch-sync providers as a play to the end, so
  providers that judge completion from progress record it too.
- Explain the credits rule under "Mark watched at" in web admin, and in
  the admin, Jellyfin, and marker API docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Nov 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T22:10:35.367667Z 672a89c New commits
🔒 Security Review ✅ Completed 2026-11-22T22:17:45.776162Z 672a89c New commits

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Nov 22, 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 ❌

@silo-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Playback completion now recognizes eligible end-credit markers in addition to the watched threshold. This applies across API playback, compatibility reports, progress state, and watch-sync events. Documentation and localized settings text describe the credits-based completion rule.

Changes: End-Credits Completion

Layer / File(s) Summary
Shared completion thresholds
internal/markers/credits_placement.go, internal/userstore/threshold.go, internal/userstore/threshold_test.go, internal/notifications/interest_hooks.go, internal/watchstate/service.go
The shared watched-state check accepts a valid credits start. Progress resolution checks completion before applying the minimum-resume skip rule. Playback-stop recording and notification progress state use the shared check.
File-aware API playback completion
internal/api/handlers/playback.go, internal/api/handlers/playback_realtime.go, internal/api/handlers/playback_test.go, docs/admin-api.md
API playback paths use file-specific thresholds when the timeline duration matches the file duration. Tests cover stops inside credits and cases that remain incomplete. The API documentation includes credits in its completion rule.
Version-aware compatibility playback
internal/jellycompat/handlers_playback.go, internal/jellycompat/playback_scrobble.go, internal/jellycompat/playback_sessions.go, internal/jellycompat/streams.go, internal/jellycompat/playback_report_version_runtime_test.go, docs/jellycompat-api.md
Compatibility playback resolves the played version and applies credits thresholds only when that version is identified. Tests cover completion at the identified version’s credits and non-completion for other or unidentified versions.
Completed-stop watch-sync mapping
internal/watchsync/plugin_provider.go, internal/watchsync/plugin_provider_test.go
Completed stops with a positive duration use the full duration as the outgoing event position. Tests check the position and completion percentage for completed and unfinished stops.
Credits behavior documentation and settings
docs/markers-api.md, web/src/pages/admin-settings/PlaybackSettings.tsx, web/src/locales/keys.ts, web/src/locales/*.json, .silo-translations
Marker documentation describes credits placement and watched-state behavior. The playback setting displays a localized description, and locale catalogs include that text.

Playback Transport Message Localization

Layer / File(s) Summary
Superseded transport message translations
web/src/locales/keys.ts, web/src/locales/*.json
The translation-key catalog and locale catalogs add a message for playback continuing on the current stream after a transport is superseded.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant JellycompatStreams
  participant ReportedSource
  participant SourceThresholds
  participant ProgressThresholds
  JellycompatStreams->>ReportedSource: resolve source and identification status
  JellycompatStreams->>SourceThresholds: provide source and identification status
  SourceThresholds-->>JellycompatStreams: return source-specific thresholds
  JellycompatStreams->>ProgressThresholds: evaluate reported position
Loading

Suggested reviewers: blurbery, rhainland

Merge Risk: Minimal · up to 672a8

This change marks a title watched when playback reaches a stored end-credits marker, or the configured percentage, whichever comes first. Credits apply only when the played file and its timeline are known, so substituted or guessed versions and offline syncs keep the percentage rule. No concrete defect remains that should block merging.

Security architecture risk: Minimal · up to 672a8

The completion rule changes when playback is considered finished, but the inspected paths retain the existing user and profile ownership. Credits are restricted to eligible markers and identified playback versions. No introduced security or failure-containment concern was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The incremental effect in the inspected paths is earlier completion of the existing session identity's progress, history, same-file episode span, and downstream watch-sync events. Client-reported position already had authority to complete playback through the percentage threshold; the credits rule does not establish new cross-user authority.

Trust Boundaries and Controls

  • observed — Compatibility playback distinguishes an identified source from a first-listed fallback. Unidentified sources supply no credits threshold. After reaping, an unidentified fallback leaves MediaFileID unset and places its history guess in RequestedMediaFileID; the native threshold guard rejects using that guessed file's credits.

Resilience and Maintainability Implications

  • observed — Native transport cleanup remains independent of whether credits complete the item. Finalization closes transport and removes proxy grants and node recipes before recording stop history; a genuine user stop also retains the existing stream-deny step. The inspected threshold change does not condition these revocations on successful completion persistence.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: playback marks an item watched when it reaches the end credits. The changeset adds credits-start completion logic in the playback, progress, and Jellyfin-compatibilit…
Description check Passed The description explains the problem (viewers stop at the end credits, and the 90% threshold keeps titles in Continue Watching), the approach (a shared Watched predicate, file-aware credits thresholds…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: playback marks an item watched when it reaches the end credits. The changeset adds credits-start completion logic in the playback, progress, and Jellyfin-compatibility paths, plus the matching docs and locale strings. The title is specific and uses the conventional commit format.

Full details: Description check

Explanation

The description explains the problem (viewers stop at the end credits, and the 90% threshold keeps titles in Continue Watching), the approach (a shared Watched predicate, file-aware credits thresholds, and Jellyfin source credits start), validation, and risks. These match the changes in the diff, including the playback, userstore, markers, jellycompat, watchsync, and locale files.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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: 5ed5de0a-2303-42e2-9669-aa4ff6207420
Commits

Reviewing files that changed from the base of the PR and between 74032ee and 672a89c.

Files selected for processing: 5

  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_realtime.go
  • internal/api/handlers/playback_test.go
  • internal/jellycompat/playback_report_version_runtime_test.go
  • internal/jellycompat/streams.go

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

@Quick104 Quick104 left a comment

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.

Adversarial review (claude-opus-5-5, reviewed 24d4e81)

One low-severity finding, inline. I checked the rest and found no problems: completion is decided before the min-resume floor in the two store backends, offline sync, and both watchstate stop paths. The native heartbeat, stop, realtime stop, admin history and span marking all build thresholds from the loaded file. Notifications interest tracking follows Watched. The watch-sync full-position override applies only to completed stops.

This review was written by an AI model (claude-opus-5-5).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24d4e81d18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/api/handlers/playback.go Resolved
WatchedAt: formatWatchedAt(watchedAt),
DurationSeconds: duration,
Completed: duration > 0 && position/duration > userstore.WatchedFraction(thresholds.WatchedPct),
Completed: thresholds.Watched(position, duration),

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 Kody Rules high

Later stops cannot advance an existing play to credits completion

An earlier incomplete stop prevents a later stop from advancing the play's completion, watched time, or end time because RecordPlaybackStopOnce ignores existing history IDs. Use a monotonic history upsert and write hints only when the stop records or advances the play.

Kody rule violation: Make playback finalization monotonic and consume dispatch state only after success

Prompt for LLM
File internal/watchstate/service.go, line 280:

Later stops cannot advance an existing play to credits completion

A later stop can now reach the credits marker and calculate completion here, but `RecordPlaybackStopOnce` treats an existing history ID as an unconditional no-op. If an earlier stop recorded the play as incomplete, the later stop cannot advance its completion, watched time, or end time. Use a monotonic history upsert that advances the existing play when appropriate, and write hints only when that stop records or advances it.

Kody rule violation: [Make playback finalization monotonic and consume dispatch state only after success](https://kodus.siloserver.org/settings/code-review/1247142351/kody-rules/d467b6b4-45c0-4c35-be95-d699f19a5c91?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)

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.

This predates the PR: with the percentage rule alone, a second stop of the same Jellyfin play that passes 90% after an earlier stop below it hits the same ErrHistoryEntryExists no-op. This change only adds another way to cross into completed, so it's out of scope here; I'm leaving the thread open for the maintainer and noting it as a possible follow-up once it's confirmed on main.

🤖 Claude Code in T3 Code (claude-opus-5-5)

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 scope assessment makes sense: if the same later-stop behavior occurs under the existing percentage rule on main, it is a pre-existing issue rather than a regression introduced by this PR. The new credits threshold adds another way to encounter it, but does not appear to cause it.

Leaving the thread open for the maintainer and considering a follow-up after confirming the behavior on main is reasonable.

…uilds it

A Jellyfin play session didn't know whether its item was a movie or an
episode, and reloading it from the durable store dropped every credits
occurrence but the first. PlaybackInfo now resolves where each source's
end credits start, with the item's own window and every occurrence, and
stores that one value on the source; progress reports and stop scrobbles
read it. Sessions stored before this keep the percentage rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

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: 0fdfc923-d041-43bf-b365-828a4f48e292
Commits

Reviewing files that changed from the base of the PR and between 4d5040e and 24d4e81.

Files selected for processing: 61

  • .silo-translations
  • docs/admin-api.md
  • docs/jellycompat-api.md
  • docs/markers-api.md
  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_realtime.go
  • internal/api/handlers/playback_test.go
  • internal/jellycompat/handlers_playback.go
  • internal/jellycompat/playback_report_version_runtime_test.go
  • internal/jellycompat/playback_scrobble.go
  • internal/jellycompat/streams.go
  • internal/markers/credits_placement.go
  • internal/notifications/interest_hooks.go
  • internal/userstore/threshold.go
  • internal/userstore/threshold_test.go
  • internal/watchstate/service.go
  • internal/watchsync/plugin_provider.go
  • internal/watchsync/plugin_provider_test.go
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/pages/admin-settings/PlaybackSettings.tsx

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

Comment thread docs/jellycompat-api.md Resolved
Comment thread docs/markers-api.md Resolved
Comment thread internal/api/handlers/playback.go Resolved
Comment thread web/src/locales/ca.json Resolved
Comment thread web/src/locales/en.json Resolved
A stop scrobbled after the upstream session was reaped took its file from
the first listed source when nothing identified the played version, and
the scrobble then judged that cut's credits as the played one's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

@silo-kody

silo-kody Bot commented Nov 22, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74032eef98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/api/handlers/playback.go Resolved
When v3 substituted another file for the requested one, such as a
lower-bitrate version or the next part of a multipart title, the native
paths judged the streamed position against the requested file's credits.
Those sessions keep the percentage rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌

@Quick104 Quick104 left a comment

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.

Adversarial review (claude-opus-5-5, reviewed 65fb066, round 3)

I looked at the round-3 changes (4be60ca, 74032ee, 65fb066) and the code that calls them. The native guard in 65fb066 is consistent across all four callers of playbackThresholdsForFile (heartbeat, stop, realtime stop, admin history). Each session constructor and the detached attempt-row session carry both MediaFileID and RequestedMediaFileID, so the guard sees the file the session actually streams. The docs changes match the code.

One finding, inline: when the stop arrives after the native session was reaped, 4be60ca's fix is undone one step later, in compatStopSnapshot.

This review was written by an AI model (claude-opus-5-5).

@Quick104 Quick104 left a comment

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.

Adversarial review (gpt-6.2-sol, reviewed 65fb066, round 3)

Three findings verified by tracing the pinned source.

AI disclosure: This review was written by gpt-6.2-sol.

Comment thread internal/api/handlers/playback.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Credits must come from the file the session plays. · playback.go:1055-1068

internal/api/handlers/playback.go:1055-1068
Minor · Functional Correctness · Quick win

Credits must come from the file the session plays.

persistProgress (playback.go:1055-1068) and persistStopAndHistory (playback.go:1113-1124) load the requested file and apply its end-credits marker. When a session streams a different file, the position belongs to the streamed file, but the credits window comes from the requested file. The duration check does not catch this, because duration is taken from the loaded file itself.

A played file can then be marked watched at a credits start from another version. If the markers differ, completion can occur early or late. The fix must take the credits window from session.MediaFileID. Skipping credits when the IDs differ would fall back to the percentage rule and remove the credits completion this change adds for substitute plays.

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: 211cc120-abc3-4851-9b46-dfdf393cfe74
Commits

Reviewing files that changed from the base of the PR and between 24d4e81 and 74032ee.

Files selected for processing: 9

  • docs/jellycompat-api.md
  • docs/markers-api.md
  • internal/api/handlers/playback.go
  • internal/jellycompat/handlers_playback.go
  • internal/jellycompat/playback_report_version_runtime_test.go
  • internal/jellycompat/playback_scrobble.go
  • internal/jellycompat/playback_sessions.go
  • internal/jellycompat/streams.go
  • internal/markers/credits_placement.go
Files skipped from review as they are similar to previous changes: 1

  • docs/markers-api.md

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

Comment thread internal/api/handlers/playback.go Resolved

@Quick104 Quick104 left a comment

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.

Adversarial review (gemini-4-neon, reviewed 65fb066, round 3)

Checked the round-3 commits (4be60ca, 74032ee, 65fb066) and their callers. playbackThresholdsForFile (65fb066) and the doc updates (74032ee) hold up. One verified issue remains: compatStopSnapshot in internal/jellycompat/streams.go:2034 still calls compatScrobbleSource, which immediately overwrites the MediaFileID = 0 that 4be60ca left unset on an unidentified fallback session, defeating the fix.

AI-assisted review generated with Gemini 4 Neon (gemini-4-neon).

…file only

The stop snapshot after a reap refilled the session's file with the first
listed version for the detached history write, and the stop scrobble then
took that guess as the played version and applied its credits. The
scrobble now uses the file the fallback identified; history keeps the
guess as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d6b9a0c3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/jellycompat/streams.go Resolved
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

@Quick104

Copy link
Copy Markdown
Contributor Author

On the outside-diff note about credits from the played file (playback.go 1055–1068 and 1113–1124): since 65fb066, playbackThresholdsForFile applies credits only when the loaded file is the one the session streams (session.MediaFileID), and since 811d223 only on that file's own timeline. A session that streams a substituted version keeps the percentage rule. That's how every session behaved before this PR, so substitute plays lose nothing they had. Reading the streamed copy's markers instead would add a second file lookup to every heartbeat. It's listed under "Not covered" in the description.

🤖 Claude Code in T3 Code (claude-opus-5-5)

…treamed file

A Jellyfin stop handled after the native session was reaped, for a play
that never identified its version, recorded the first listed version as
the streamed file, so native history applied that version's credits. The
guess now goes in RequestedMediaFileID, which history loads, and the
streamed file stays unknown; credits apply only to a known streamed file.
This replaces the scrobble-only workaround from 1d6b9a0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 672a89cddc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/userstore/threshold.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 672a89cddc

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread internal/api/handlers/playback.go Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code 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.

1 participant