Skip to content

fix(jellyfin): keep the picked subtitle among identical same-language files - #2880

Merged
edde746 merged 2 commits into
edde746:mainfrom
jucor:jellyfin-duplicate-subtitle-pick
Oct 30, 2026
Merged

edde746 merged 2 commits into
edde746:mainfrom
jucor:jellyfin-duplicate-subtitle-pick

Conversation

@jucor

@jucor jucor commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Hi !

On Jellyfin, two external subtitles in the same language get identical labels -- for instance one Jellyfin downloaded next to one you already had. Picking either of them from the tracks sheet then plays no subtitle at all: _validJellyfinSubtitleStreamId re-derives the pick from its language and title (the #1716 guard), finds two equally good rows, and gives up.

This PR lets the explicit pick settle that tie, but only when its own row is one of the tied ones. A stale index pointing at a row that matches worse still gives up, as #1785 intends.

How I checked it

  • A new test with two identical English subtitles and a third, different one. Picking one of the twins: on main, playback starts with no subtitle at all; with this PR, with the one picked. A stale pick pointing at the third one still gets none.
  • Full suite on macOS: 8,313 pass.

#2875 needs this, as a downloaded subtitle usually lands next to an identical one.

Disclosure: I piloted Claude Opus 5.5 (Anthropic) at high effort to write the change and run the tests.

Thanks a lot for considering it !

… files

Jellyfin labels two external subtitle files in the same language
identically, so the intent matching that guards a source id found a tie
and requested no subtitle at all. The explicit pick now settles the tie,
provided its own row passes the same language and forced checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stale index pointing at a row the intent ranks below the tied pair
must still decline, as the edde746#1785 guard intends. The test now covers that
case, with a smaller fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jucor
jucor marked this pull request as ready for review October 29, 2026 04:56
@edde746
edde746 merged commit 4f2a4f2 into edde746:main Oct 30, 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