Make config path configurable

This commit is contained in:
Bond_009
2019-01-05 19:12:05 +01:00
parent d3b0ba978c
commit 2850ff7b8a
3 changed files with 57 additions and 5 deletions

View File

@@ -12,11 +12,16 @@ namespace Emby.Server.Implementations.AppBase
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationPaths"/> class.
/// </summary>
protected BaseApplicationPaths(string programDataPath, string appFolderPath, string logDirectoryPath)
protected BaseApplicationPaths(
string programDataPath,
string appFolderPath,
string logDirectoryPath = null,
string configurationDirectoryPath = null)
{
ProgramDataPath = programDataPath;
ProgramSystemPath = appFolderPath;
LogDirectoryPath = logDirectoryPath;
ConfigurationDirectoryPath = configurationDirectoryPath;
}
public string ProgramDataPath { get; private set; }
@@ -134,6 +139,11 @@ namespace Emby.Server.Implementations.AppBase
}
}
/// <summary>
/// The _config directory
/// </summary>
private string _configurationDirectoryPath;
/// <summary>
/// Gets the path to the application configuration root directory
/// </summary>
@@ -142,7 +152,18 @@ namespace Emby.Server.Implementations.AppBase
{
get
{
return Path.Combine(ProgramDataPath, "config");
if (string.IsNullOrEmpty(_configurationDirectoryPath))
{
_configurationDirectoryPath = Path.Combine(ProgramDataPath, "config");
Directory.CreateDirectory(_configurationDirectoryPath);
}
return _configurationDirectoryPath;
}
set
{
_configurationDirectoryPath = value;
}
}