From 0a0303ca64e346f0e939f1fe275334f752728c15 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 Nov 2017 15:50:16 -0400 Subject: normalize strm file contents --- .../Configuration/ServerConfigurationManager.cs | 67 +++++++++++----------- 1 file changed, 35 insertions(+), 32 deletions(-) (limited to 'Emby.Server.Implementations/Configuration') diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 4d9bf0624..607e896b8 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -195,52 +195,55 @@ namespace Emby.Server.Implementations.Configuration } } - public void DisableMetadataService(string service) + public bool SetOptimalValues() { - DisableMetadataService(typeof(Movie), Configuration, service); - DisableMetadataService(typeof(Episode), Configuration, service); - DisableMetadataService(typeof(Series), Configuration, service); - DisableMetadataService(typeof(Season), Configuration, service); - DisableMetadataService(typeof(MusicArtist), Configuration, service); - DisableMetadataService(typeof(MusicAlbum), Configuration, service); - DisableMetadataService(typeof(MusicVideo), Configuration, service); - DisableMetadataService(typeof(Video), Configuration, service); - } + var config = Configuration; - private void DisableMetadataService(Type type, ServerConfiguration config, string service) - { - var options = GetMetadataOptions(type, config); + var changed = false; - if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase)) + if (!config.EnableCaseSensitiveItemIds) { - var list = options.DisabledMetadataSavers.ToList(); - - list.Add(service); + config.EnableCaseSensitiveItemIds = true; + changed = true; + } - options.DisabledMetadataSavers = list.ToArray(list.Count); + if (!config.SkipDeserializationForBasicTypes) + { + config.SkipDeserializationForBasicTypes = true; + changed = true; } - } - private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config) - { - var options = config.MetadataOptions - .FirstOrDefault(i => string.Equals(i.ItemType, type.Name, StringComparison.OrdinalIgnoreCase)); + if (!config.EnableSimpleArtistDetection) + { + config.EnableSimpleArtistDetection = true; + changed = true; + } - if (options == null) + if (!config.EnableNormalizedItemByNameIds) { - var list = config.MetadataOptions.ToList(); + config.EnableNormalizedItemByNameIds = true; + changed = true; + } - options = new MetadataOptions - { - ItemType = type.Name - }; + if (!config.DisableLiveTvChannelUserDataName) + { + config.DisableLiveTvChannelUserDataName = true; + changed = true; + } - list.Add(options); + if (!config.EnableNewOmdbSupport) + { + config.EnableNewOmdbSupport = true; + changed = true; + } - config.MetadataOptions = list.ToArray(list.Count); + if (!config.EnableLocalizedGuids) + { + config.EnableLocalizedGuids = true; + changed = true; } - return options; + return changed; } } } -- cgit v1.2.3 From d765f370b35bdc8c74a6b74a82796efcea97f762 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 Nov 2017 15:56:20 -0400 Subject: update librarymanager --- .../Configuration/ServerConfigurationManager.cs | 6 ------ Emby.Server.Implementations/Library/LibraryManager.cs | 2 +- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) (limited to 'Emby.Server.Implementations/Configuration') diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 607e896b8..e73a69892 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -237,12 +237,6 @@ namespace Emby.Server.Implementations.Configuration changed = true; } - if (!config.EnableLocalizedGuids) - { - config.EnableLocalizedGuids = true; - changed = true; - } - return changed; } } diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index cac1cb3b4..bd8a09550 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -506,7 +506,7 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException("type"); } - if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) + if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length) diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 9b800bbc9..f2c3b7cc8 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -189,8 +189,6 @@ namespace MediaBrowser.Model.Configuration public PathSubstitution[] PathSubstitutions { get; set; } public bool EnableSimpleArtistDetection { get; set; } - public bool EnableLocalizedGuids { get; set; } - /// /// Initializes a new instance of the class. /// @@ -202,7 +200,6 @@ namespace MediaBrowser.Model.Configuration PathSubstitutions = new PathSubstitution[] { }; EnableSimpleArtistDetection = true; - EnableLocalizedGuids = true; DisplaySpecialsWithinSeasons = true; EnableExternalContentInSuggestions = true; -- cgit v1.2.3