mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[10.11-RC4] Automatic subtitle selection not working when Spanish is set as preferred subtitle language #7248
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#7248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @a-collado on GitHub (Aug 12, 2025).
Description of the bug
Sorry about opening the same issue two times in a row, but my last issue got incorrectly closed as a duplicate. Please read closely the issue, it is not the same problem as #1358 , it is a new behaviour introduced in v10.11-RC4. Thank you.
After upgrading to version 10.11-RC4, if you set your preferred subtitle language to Spanish (either Spanish;Latin or Spanish;Castillian), and you have enabled "Smart" Subtitle mode, when you select media to play, it doesn't have any subtitle track selected, even if there is a Spanish subtitle track. This doesn't seem to happen with any other language.
I've tried to track down the issue, so I've debugged the function
GetDefaultSubtitleStreamIndexinEmby.Server.Implementations/Library/MediaStreamSelector.csto see why it doesn't select any track. I've found that in version 10.11-RC4 if you select Spanish as preferred subtitle language,preferredLanguageshas the valuees-mx, whereas in 10.11-RC3 the value wases. This seems to be why now the language doesn't coincide with any track, and why then no track is selected. I don't know if this change is intended, but it makes the "Smart" subtitle mode unusable.Reproduction steps
What is the current bug behavior?
The subtitles of the media are off.
What is the expected correct behavior?
A Spanish subtitle track should be selected.
Jellyfin Server version
Unstable
Specify commit id
No response
Specify unstable release number
No response
Specify version number
10.11.0-rc4
Specify the build version
10.11.0-rc4
Environment
Jellyfin logs
FFmpeg logs
Client / Browser logs
No response
Relevant screenshots or videos
No response
Additional information
Screenshot of the variable
preferredLanguagesin the debugger@a-collado commented on GitHub (Aug 12, 2025):
I've found where this issue was introduced. This PR #14410 changes the function
NormalizeLanguagein the fileEmby.Server.Implementations/Library/MediaSourceManager.cs, to make that if the name of a language contains a-, it uses the name of the culture instead of the language name.The problem here is that if you select Spanish as your preferred subtitle language, when normalizing the language name in the
NormalizeLanguagefunction, thelocalizationManageralways sets the culture asSpanish; Latin, because Jellyfin does not differentiate betweenSpanish; LatinandSpanish; Castillian, andSpanish; Latinis first on the culture list so it selects it.The culture name contains of
Spanish; Latinises-mx, it contains a-so insead of returning the three letter ISO language name,spa, it returns the culture name,es-mx. Then, inEmby.Server.Implementations/Library/MediaStreamSelector.cs, when the language of the subtitles streams are compared to the preferred subtitle language, it comparesspa(the language of the stream) withes-mx(the preferred subtitle language).I don't know if the best approach would be to force the Spanish normalized name to be
spa, or to normalize the media stream languages.@theguymadmax commented on GitHub (Aug 14, 2025):
@a-collado was the issue fixed by your PR #14639
@a-collado commented on GitHub (Aug 14, 2025):
@theguymadmax no, the issue remains the same, just changing
es-mxbyes-419. A "solution" i've found is to change the order ofSpanish; LatinandSpanish; CastillianinEmby.Server.Implementations/Localization/iso6392.txtlike in this commit but it is more a quick and dirty fix than an actual solution to the underlying problem.@gnattu commented on GitHub (Aug 17, 2025):
This is due to how Jellyfin currently relies on to "correctly" normalize the subtitle selection options. Currently the logic requires the normalizer to normalize to the non-culture-specific variant (aka, a version without
-) to correctly work, and the order does matter in that file, and Spanish is unfortunately a language has no "culture neutral" normalization. For other languages also with culture variants like Portuguese and Chinese, the culture neutral one (por/pt and zho/chi/zh) is always the first which will match the stream languages correctly. For Spanish, may be we have to make Castillian variant as a "default" version instead like what28814a8944does if we are not ready to refactor the normalizer for now.@jellyfin-bot commented on GitHub (Dec 16, 2025):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.