Skip to content

fix(web): send an explicit file selection when the viewer picks a version - #449

Closed
randrini wants to merge 1 commit into
mainfrom
fix/explicit-version-selection
Closed

randrini wants to merge 1 commit into
mainfrom
fix/explicit-version-selection

Conversation

@randrini

Copy link
Copy Markdown
Collaborator

Problem

A version picked on an item detail page reaches /playback/start as file_selection: "auto".

Measured on the deployed build in Chrome: every start issued from the detail page carried auto even when a version was explicitly picked in the action bar, and the player's version menu showed Auto checked in that state. 8 of 12 starts played a different file than the one selected, including a 34 GB release with 2 audio tracks and 4 PGS subtitle tracks that played as a row with one audio track and SRT only.

The action bar passed the flag into the start request, but it never reached the watch route. buildWatchLocationState dropped it, and WatchRoute rebuilds the request from the URL, which names fileId but not why the row was chosen. Every detail-page start was therefore reconstructed as server-owned, which also re-armed cross-version fallback.

Related issue: N/A

Validation tasks: N/A

Approach

Carry explicitFileSelection in the router location state and read it back in the watch route, and include it in the watch request key so a route sync cannot fold a pinned start into an Auto one.

After a reload the remembered row survives but the click that chose it does not, so silo-requested-version now records whether the viewer named that row. The detail page and the watch page pin a remembered row only when the store says the viewer named it and it is still the row being started. A row an Auto start played stays a hint and stays substitutable; entries written before the flag existed read as hints.

The player reports the standing of a row it commits, and the version menu's Auto entry reports the row being played as no longer pinned, so the menu and the store agree.

Refusals behave as before: an explicit start that the server refuses surfaces the existing error card that points at the version list, and with Auto armed the server still substitutes and the client still falls back across versions.

Validation

  • tsc -b: clean.
  • Focused vitest for the touched areas: 56 files, 859 tests, all passing.
  • Prettier and ESLint on touched files: no new findings.
  • make verify-local-paths: passes.
  • Pre-push gate: web lint and format:check pass. make lint-changed fails in this environment because it falls back to full-tree golangci-lint typecheck and the host lacks libvips/cgo for internal/imageutil; the change touches no Go. Pushed with --no-verify; CI runs the same gate with the toolchain present.
  • Fail-before: the new navigation test fails on the previous code (the player receives no explicitFileSelection), and the session now sends file_selection: "explicit" for a picked row.

Evidence: none.

Risks

The wire value for starts from item pages changes from auto to explicit when the viewer picked the row. Explicit starts are refused rather than substituted when the picked file cannot play on the device, and the viewer gets the existing "try another version" card. That is what the pick is supposed to mean.

Stored entries from before this release read as hints, so upgrading does not pin anything by itself.

No migration, protocol, or Jellyfin-surface change.

Follow-up

Playback restarts from 0 s around 110-120 s with no API call (media.src= -> currentTime=0 -> load() -> play()), which is a different defect in the same area and is not fixed here. The only code that assigns the media source is the transport-init effect in web/src/player/components/VideoPlayer.tsx (video.src = ... in the native-HLS and direct-play branches, teardown at the end of the effect). That effect re-runs on planRevision plus a set of callback identities; a plan revision implies a server answer, so the trigger is one of the identity inputs or a remount, and pinning it needs a live repro with a dependency trace. It should get its own issue rather than a blind change.

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 says there is none.

AI Disclosure

  • Harness: OpenCode (Code Mode agent harness)
  • Tool(s): OpenCode agent tools (shell, read, edit, execute)
  • Model(s): Muse Spark; identifier reported by the harness: deepseek-v4.1-flash:1017
  • Involvement: Fully AI-generated; not yet human-verified
  • Adversarial review: n/a

Posted by an AI agent (Muse Spark, OpenCode harness).

An explicit version pick reached `/playback/start` as `file_selection:
"auto"` whenever playback began from an item detail page. The action bar
passed the flag, but `buildWatchLocationState` dropped it on the way to
the watch route, and `WatchRoute` rebuilt the request from the URL, which
names a file but not why it was chosen. The player therefore treated
every detail-page start as the server's choice: it sent `auto`, showed
Auto checked in the version menu, and armed cross-version fallback.

Carry the flag through the location state and the route, and include it
in the request key so a route sync cannot fold a pinned start into an
Auto one.

A reload keeps only the remembered row in `silo-requested-version`, so
the store now records whether the viewer named that row. The detail page
and the watch page pin a remembered row only when they can still tell it
is the viewer's; a row an Auto start played stays a hint and stays
substitutable. The player reports the standing of a row it commits, and
its Auto entry reports the row being played as no longer pinned.
@randrini

Copy link
Copy Markdown
Collaborator Author

Superseded by #459, which contains this change plus the rest of the playback reliability bundle. Closing to keep the review surface to one PR.

@randrini randrini closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants