diff options
| author | Greenback <jimcartlidge@yahoo.co.uk> | 2020-10-08 19:00:55 +0100 |
|---|---|---|
| committer | Greenback <jimcartlidge@yahoo.co.uk> | 2020-10-08 19:00:55 +0100 |
| commit | deb4d27857089e8f3a3602399c5b52ad8df170f2 (patch) | |
| tree | 18c3ec379b72e20843caff9dad907d1842cbcbd8 /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs | |
| parent | a3f0843ac97c64a8a412d707baa9870d0e53dcff (diff) | |
Moved all settings across to network.xml
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 4ab0a2a3f..fa4b3080c 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -10,6 +10,7 @@ using MediaBrowser.Common.Extensions; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; +using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.AppBase @@ -268,7 +269,7 @@ namespace Emby.Server.Implementations.AppBase } /// <inheritdoc /> - public object GetConfiguration(string key) + public object GetConfiguration(string key, Type objectType = null) { return _configurations.GetOrAdd(key, k => { @@ -277,12 +278,12 @@ namespace Emby.Server.Implementations.AppBase var configurationInfo = _configurationStores .FirstOrDefault(i => string.Equals(i.Key, key, StringComparison.OrdinalIgnoreCase)); - if (configurationInfo == null) + if (configurationInfo == null && objectType == null) { throw new ResourceNotFoundException("Configuration with key " + key + " not found."); } - var configurationType = configurationInfo.ConfigurationType; + var configurationType = configurationInfo?.ConfigurationType ?? objectType; lock (_configurationSyncLock) { |
