fix: group subtitles by language - #3127
Conversation
refirestream
commented
Aug 17, 2026
- Group subtitle tracks by language name derived from IETF tag instead of raw originalName (e.g. "fr" and "French [SUB]" now land in the same "French" group)
- Fall back to "Unknown" group when language cannot be resolved
- Label tracks within a group by originalName instead of nameSuffix
- Filter subtitles by IETF tag match instead of name substring, matching primary subtag so regional variants (pt-br) match (pt)
- Keep subtitles with unresolvable language instead of dropping them (goes into the Unknown group)
- Group subtitle tracks by language name derived from IETF tag instead of raw originalName (e.g. "fr" and "French [SUB]" now land in the same "French" group) - Fall back to "Unknown" group when language cannot be resolved - Label tracks within a group by originalName instead of nameSuffix - Filter subtitles by IETF tag match instead of name substring, matching primary subtag so regional variants (pt-br) match (pt) - Keep subtitles with unresolvable language instead of dropping them - Only exempt DOWNLOADED_FILE from filtering so embedded tracks are also filtered across player reloads - Use getApiProviderLangSettings + fromCodeToLangTagIETF for proper tag normalization in the filter list
|
Doing this pull request, I discovered that there is a setting to filter out "useless" languages in : People that have not selected the correct languages during setup might be annoyed though. If we enable the "Filter by preferred media language" setting now, will it change the value for existing users ? |
|
I tested the app manually and its working well |
fire-light42
left a comment
There was a problem hiding this comment.
Good idea and minimal code changes, but needs some small changes.
Changing default behavior needs a lot of motivation, since users have come to expect that this is how CloudStream works. I think it would be too confusing. I would rather recommend a more subtle and visible solution, for example always placing preferred languages at the top of subtitle languages. However, this is best done as a separate pull request.
It would change the value for all users who have not previously changed the value, unless it is explicitly migrated using code. |
Replace the groupName() helper with a single pass that pairs each subtitle with its resolved language name, then derive the grouping, the selected group and both start indices from that list instead of recomputing the name on demand. Generated with AI
Number tracks that share the exact same original name within a language group (e.g. two "Français" tracks become "Français 1" and "Français 2"), reusing the track's own nameSuffix when it has one and generating a sequential number otherwise. Unique names are untouched. Generated with AI
b114426 to
e01c5f3
Compare