mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
Hide ISO 639-2 special codes in display titles
They are still shown in associated metadata, just hidden from the more visible display titles.
This commit is contained in:
parent
f0c28019dc
commit
e09641b452
|
@ -17,6 +17,18 @@ namespace MediaBrowser.Model.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MediaStream
|
public class MediaStream
|
||||||
{
|
{
|
||||||
|
private static readonly string[] _specialCodes =
|
||||||
|
{
|
||||||
|
// Uncoded languages.
|
||||||
|
"mis",
|
||||||
|
// Multiple languages.
|
||||||
|
"mul",
|
||||||
|
// Undetermined.
|
||||||
|
"und",
|
||||||
|
// No linguistic content; not applicable.
|
||||||
|
"zxx"
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the codec.
|
/// Gets or sets the codec.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -137,7 +149,8 @@ namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
var attributes = new List<string>();
|
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.
|
// 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
|
string fullLanguage = CultureInfo
|
||||||
|
|
Loading…
Reference in a new issue