Extract truncation logic to helper and add tests

This commit is contained in:
854562
2026-07-20 22:00:10 +02:00
committed by GitHub
parent c632417dda
commit 2cd2f36fe4
5 changed files with 63 additions and 11 deletions
@@ -172,11 +172,7 @@ public class MediaStreamRepository : IMediaStreamRepository
if (!string.IsNullOrEmpty(dto.Language))
{
var culture = _localization.FindLanguageInfo(dto.Language);
// Truncate at the first delimiter to avoid cluttered display names
dto.LocalizedLanguage = culture?.DisplayName is { } name
? name.Split([';', ','])[0].Trim()
: null;
dto.LocalizedLanguage = _localization.GetLanguageDisplayName(dto.Language);
}
if (dto.Type is MediaStreamType.Audio)