aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-03-05 12:43:51 -0700
committerGitHub <noreply@github.com>2022-03-05 12:43:51 -0700
commit3dc0cfc36edbc43f43c2b94804a9f7f4c3a5bd8e (patch)
tree25ac9d3bfe31af71fd2bc9a871c3fbbcb00a58ae
parent4791d56f6ce7b1ed5666592739fb3417830be093 (diff)
parent3f6a14e1fd458eb6455d2c07f516dc827fdf3239 (diff)
Merge pull request #7388 from GermanCoding/iso639-undefined
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index 38ac44794..341e4846e 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
+using Jellyfin.Extensions;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
@@ -17,6 +18,18 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public class MediaStream
{
+ private static readonly string[] _specialCodes =
+ {
+ // Uncoded languages.
+ "mis",
+ // Multiple languages.
+ "mul",
+ // Undetermined.
+ "und",
+ // No linguistic content; not applicable.
+ "zxx"
+ };
+
/// <summary>
/// Gets or sets the codec.
/// </summary>
@@ -137,7 +150,8 @@ namespace MediaBrowser.Model.Entities
{
var attributes = new List<string>();
- if (!string.IsNullOrEmpty(Language))
+ // Do not display the language code in display titles if unset or set to a special code. Show it in all other cases (possibly expanded).
+ if (!string.IsNullOrEmpty(Language) && !_specialCodes.Contains(Language, StringComparison.OrdinalIgnoreCase))
{
// 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