aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermanCoding <github@germancoding.com>2022-03-04 00:55:20 +0100
committerGermanCoding <github@germancoding.com>2022-03-04 00:55:20 +0100
commite09641b452fcdd76c08dc18abeefa089f92212f1 (patch)
tree63e5ae3e3a83b24e6592addec08632e8140f353a
parentf0c28019dc3deb128fa15d44db69b39b797e3554 (diff)
Hide ISO 639-2 special codes in display titles
They are still shown in associated metadata, just hidden from the more visible display titles.
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index 38ac44794..d89d629d2 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -17,6 +17,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 +149,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, StringComparer.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