diff options
| author | 854562 <44002186+854562@users.noreply.github.com> | 2026-06-22 20:25:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-22 20:25:13 +0200 |
| commit | 94d53264111b2fee3824afeaa0eea69f6ecd7e83 (patch) | |
| tree | 76acde30a784b613f746d5b11fc0d37f54950c6f | |
| parent | da2b994fff284ef35dcae87beaf9def9072aa18a (diff) | |
Truncate ISO-639-2 language display names at first delimiter
Prevents raw ISO-639-2 values (e.g. "Greek, Modern (1453-)" from cluttering the audio and subtitle display names by truncating them at the first comma or semicolon ("Greek"). Applies to MediaStreamRepository and ProbeResultNormalizer.
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs index 7fa33c8639..b3c7fe131e 100644 --- a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs +++ b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs @@ -173,7 +173,10 @@ public class MediaStreamRepository : IMediaStreamRepository if (!string.IsNullOrEmpty(dto.Language)) { var culture = _localization.FindLanguageInfo(dto.Language); - dto.LocalizedLanguage = culture?.DisplayName; + // Truncate at the first delimiter to avoid cluttered display names + dto.LocalizedLanguage = culture?.DisplayName is { } name + ? name.Split(';', ',')[0].Trim() + : null; } if (dto.Type is MediaStreamType.Audio) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 06060988e2..98bdce0e9c 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -732,7 +732,9 @@ namespace MediaBrowser.MediaEncoding.Probing stream.LocalizedOriginal = _localization.GetLocalizedString("Original"); stream.LocalizedLanguage = string.IsNullOrEmpty(stream.Language) ? null - : _localization.FindLanguageInfo(stream.Language)?.DisplayName; + : _localization.FindLanguageInfo(stream.Language)?.DisplayName is { } name + ? name.Split(';', ',')[0].Trim() + : null; stream.Channels = streamInfo.Channels; @@ -773,7 +775,9 @@ namespace MediaBrowser.MediaEncoding.Probing stream.LocalizedHearingImpaired = _localization.GetLocalizedString("HearingImpaired"); stream.LocalizedLanguage = string.IsNullOrEmpty(stream.Language) ? null - : _localization.FindLanguageInfo(stream.Language)?.DisplayName; + : _localization.FindLanguageInfo(stream.Language)?.DisplayName is { } name + ? name.Split(';', ',')[0].Trim() + : null; if (string.IsNullOrEmpty(stream.Title)) { |
