diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 2b3106e21..1e8c112b8 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -26,6 +26,7 @@ public interface IConfigFileProvider : IHandleAsync, XDocument LoadConfigFile(); Dictionary GetConfigDictionary(); void SaveConfigDictionary(Dictionary configValues); + void EnsureDefaultConfigFile(); string BindAddress { get; } int Port { get; } @@ -253,7 +254,7 @@ public bool GetValueBoolean(string key, bool defaultValue, bool persist = true) public T GetValueEnum(string key, T defaultValue, bool persist = true) { - return (T)Enum.Parse(typeof(T), GetValue(key, defaultValue), persist); + return (T)Enum.Parse(typeof(T), GetValue(key, defaultValue, persist)); } public string GetValue(string key, object defaultValue, bool persist = true) @@ -312,7 +313,7 @@ public void SetValue(string key, Enum value) SetValue(key, value.ToString().ToLower()); } - private void EnsureDefaultConfigFile() + public void EnsureDefaultConfigFile() { if (!File.Exists(_configFile)) { diff --git a/src/NzbDrone.Host/Startup.cs b/src/NzbDrone.Host/Startup.cs index 5f9e3bda2..644b934c8 100644 --- a/src/NzbDrone.Host/Startup.cs +++ b/src/NzbDrone.Host/Startup.cs @@ -224,6 +224,8 @@ public void Configure(IApplicationBuilder app, appFolderFactory.Register(); pidFileProvider.Write(); + configFileProvider.EnsureDefaultConfigFile(); + reconfigureLogging.Reconfigure(); EnsureSingleInstance(false, startupContext, singleInstancePolicy);