From ceab0be20bf2d7f568eb7c2cc669b3dce7dbb4fd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 21 Jan 2017 18:37:38 -0500 Subject: [PATCH] move metadata language to per library --- MediaBrowser.Controller/Entities/BaseItem.cs | 10 ++++++++++ .../Configuration/LibraryOptions.cs | 12 ++++++++++++ .../MediaBrowser.WebDashboard.csproj | 16 +++------------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 23dfb802c..4cfea4c70 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1337,6 +1337,11 @@ namespace MediaBrowser.Controller.Entities .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i)); } + if (string.IsNullOrWhiteSpace(lang)) + { + lang = LibraryManager.GetLibraryOptions(this).PreferredMetadataLanguage; + } + if (string.IsNullOrWhiteSpace(lang)) { lang = ConfigurationManager.Configuration.PreferredMetadataLanguage; @@ -1367,6 +1372,11 @@ namespace MediaBrowser.Controller.Entities .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i)); } + if (string.IsNullOrWhiteSpace(lang)) + { + lang = LibraryManager.GetLibraryOptions(this).MetadataCountryCode; + } + if (string.IsNullOrWhiteSpace(lang)) { lang = ConfigurationManager.Configuration.MetadataCountryCode; diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index 8e344f76e..24bc5dd11 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -15,6 +15,18 @@ public bool ImportMissingEpisodes { get; set; } public bool EnableAutomaticSeriesGrouping { get; set; } + /// + /// Gets or sets the preferred metadata language. + /// + /// The preferred metadata language. + public string PreferredMetadataLanguage { get; set; } + + /// + /// Gets or sets the metadata country code. + /// + /// The metadata country code. + public string MetadataCountryCode { get; set; } + public LibraryOptions() { EnablePhotos = true; diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index b238e1d8a..e38d30dd9 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -972,9 +972,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest @@ -1074,11 +1071,6 @@ PreserveNewest - - - PreserveNewest - - PreserveNewest @@ -1175,11 +1167,6 @@ PreserveNewest - - - PreserveNewest - - PreserveNewest @@ -1231,6 +1218,9 @@ + + PreserveNewest + PreserveNewest