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.
This commit is contained in:
854562
2026-06-22 20:25:13 +02:00
committed by GitHub
parent da2b994fff
commit 94d5326411
2 changed files with 10 additions and 3 deletions
@@ -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)