Extract truncation logic to helper and add tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user