mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
fix language settings inheritance
This commit is contained in:
@@ -976,14 +976,21 @@ namespace MediaBrowser.Controller.Entities
|
||||
lang = hasLang.PreferredMetadataLanguage;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(lang))
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = Parents.OfType<IHasPreferredMetadataLanguage>()
|
||||
.Select(i => i.PreferredMetadataLanguage)
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(lang))
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = LibraryManager.GetCollectionFolders(this)
|
||||
.Select(i => i.PreferredMetadataLanguage)
|
||||
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = ConfigurationManager.Configuration.PreferredMetadataLanguage;
|
||||
}
|
||||
@@ -1006,14 +1013,21 @@ namespace MediaBrowser.Controller.Entities
|
||||
lang = hasLang.PreferredMetadataCountryCode;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(lang))
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = Parents.OfType<IHasPreferredMetadataLanguage>()
|
||||
.Select(i => i.PreferredMetadataCountryCode)
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(lang))
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = LibraryManager.GetCollectionFolders(this)
|
||||
.Select(i => i.PreferredMetadataCountryCode)
|
||||
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(lang))
|
||||
{
|
||||
lang = ConfigurationManager.Configuration.MetadataCountryCode;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Querying;
|
||||
@@ -10,6 +7,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user