diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 3ab02ea21..50a6dda30 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -976,14 +976,21 @@ namespace MediaBrowser.Controller.Entities lang = hasLang.PreferredMetadataLanguage; } - if (string.IsNullOrEmpty(lang)) + if (string.IsNullOrWhiteSpace(lang)) { lang = Parents.OfType() .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() .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; } diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 619617e9f..4c34460d7 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -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 { diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 9871ef3c5..9c8ed45a5 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -393,5 +393,12 @@ namespace MediaBrowser.Controller.Library /// IEnumerable<Video>. IEnumerable