Skip to content

Describe the main audio track instead of the first - #323

Open
zotabee wants to merge 3 commits into
jellyfin:masterfrom
zotabee:best-audio-track
Open

zotabee wants to merge 3 commits into
jellyfin:masterfrom
zotabee:best-audio-track

Conversation

@zotabee

@zotabee zotabee commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The plugin describes the first audio track. That can be a commentary, a dub that comes first, or a compatibility track next to TrueHD or DTS-HD MA, so Trakt gets the wrong codec and channels.

A new GetBestAudioStream() is used wherever the first track was used (movie and episode export, and both MetadataIsDifferent checks):

  • it skips extra tracks: titles with commentary (in five languages), description, isolated or music & effects, and the language zxx;
  • it describes the default track, or the first one;
  • a lossless or Atmos/DTS:X track in the same language with at least as many channels replaces it, so a compatibility core isn't described;
  • only if Trakt has no value for that track's codec or channels does the best describable track win.

Ranking every track by quality instead changed 123 items on my library (4,578 movies, 14,110 episodes), only 8 of them for the better: the rest got lossless stereo instead of the default 7.1, an isolated score or a dub. With this rule, 14 items change, half of them commentary tracks that were being described.

Tested against every audio track in my library with the compiled plugin, and on my Jellyfin 12.1 server since 2026-10-18. Comparing my Trakt data exports from before and after, exactly the 14 predicted items changed, for example:

Title Tracks master This PR
Robin Hood: Men in Tights (1993) a commentary comes first aac 2.0 dts 5.1
Ghost in the Shell (1995) the English dub comes first, the Japanese original is the default dolby_digital 2.0 flac 2.0
Life (2007) S01E02-E05 a DD+ track with replacement music comes first, the original DD track is the default dolby_digital_plus 5.1 dolby_digital 5.1

Builds with no warnings on its own and merges cleanly with #320, #321, #322, #329 and #342, which change the same file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181seTYh8Bo6yc19Ba5p5bo
zotabee and others added 2 commits October 17, 2026 21:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019NK5BSFsEuuqMcNPPpysee
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.

1 participant