From d85ca5276b0ab7848575a14b027d7a3e84f07b54 Mon Sep 17 00:00:00 2001 From: Pika Date: Wed, 8 Apr 2020 18:40:38 -0400 Subject: [PATCH] Port changes from #2773 --- MediaBrowser.Model/Entities/MediaStream.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 68e0242a9..f96c4f7e0 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -85,7 +85,12 @@ namespace MediaBrowser.Model.Entities if (!string.IsNullOrEmpty(Language)) { - attributes.Add(StringHelper.FirstToUpper(Language)); + // Get full language string i.e. eng -> English. Will not work for some languages which use ISO 639-2/B instead of /T codes. + string fullLanguage = CultureInfo + .GetCultures(CultureTypes.NeutralCultures) + .FirstOrDefault(r => r.ThreeLetterISOLanguageName.Equals(Language, StringComparison.OrdinalIgnoreCase)) + ?.DisplayName; + attributes.Add(StringHelper.FirstToUpper(fullLanguage ?? Language)); } if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase)) @@ -99,7 +104,7 @@ namespace MediaBrowser.Model.Entities if (!string.IsNullOrEmpty(ChannelLayout)) { - attributes.Add(ChannelLayout); + attributes.Add(StringHelper.FirstToUpper(ChannelLayout)); } else if (Channels.HasValue) { @@ -121,7 +126,7 @@ namespace MediaBrowser.Model.Entities .ToString(); } - return string.Join(" ", attributes); + return string.Join(" - ", attributes); } case MediaStreamType.Video: