mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: (Core) Ensure default config file on starting app
Fixes #674 Fixes #1588
This commit is contained in:
@@ -25,6 +25,7 @@ namespace NzbDrone.Core.Configuration
|
|||||||
{
|
{
|
||||||
Dictionary<string, object> GetConfigDictionary();
|
Dictionary<string, object> GetConfigDictionary();
|
||||||
void SaveConfigDictionary(Dictionary<string, object> configValues);
|
void SaveConfigDictionary(Dictionary<string, object> configValues);
|
||||||
|
void EnsureDefaultConfigFile();
|
||||||
|
|
||||||
string BindAddress { get; }
|
string BindAddress { get; }
|
||||||
int Port { get; }
|
int Port { get; }
|
||||||
@@ -258,7 +259,7 @@ namespace NzbDrone.Core.Configuration
|
|||||||
|
|
||||||
public T GetValueEnum<T>(string key, T defaultValue, bool persist = true)
|
public T GetValueEnum<T>(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)
|
public string GetValue(string key, object defaultValue, bool persist = true)
|
||||||
@@ -317,7 +318,7 @@ namespace NzbDrone.Core.Configuration
|
|||||||
SetValue(key, value.ToString().ToLower());
|
SetValue(key, value.ToString().ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnsureDefaultConfigFile()
|
public void EnsureDefaultConfigFile()
|
||||||
{
|
{
|
||||||
if (!File.Exists(_configFile))
|
if (!File.Exists(_configFile))
|
||||||
{
|
{
|
||||||
|
@@ -225,6 +225,8 @@ namespace NzbDrone.Host
|
|||||||
appFolderFactory.Register();
|
appFolderFactory.Register();
|
||||||
pidFileProvider.Write();
|
pidFileProvider.Write();
|
||||||
|
|
||||||
|
configFileProvider.EnsureDefaultConfigFile();
|
||||||
|
|
||||||
reconfigureLogging.Reconfigure();
|
reconfigureLogging.Reconfigure();
|
||||||
|
|
||||||
EnsureSingleInstance(false, startupContext, singleInstancePolicy);
|
EnsureSingleInstance(false, startupContext, singleInstancePolicy);
|
||||||
|
Reference in New Issue
Block a user