aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-02-16 17:05:05 +0100
committerGitHub <noreply@github.com>2019-02-16 17:05:05 +0100
commit64a4f259a20408fe0a3c954d71d2b975d48c3d3e (patch)
treeb991ccbee7ac7a6250e4db60252557991724b3ad /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
parent3a5bbcf2a879dc78eda969e3e91c02f79e60bf0e (diff)
parent25c2267a89af5c2e82774c638cdad0defcc894b5 (diff)
Merge branch 'master' into async
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs')
-rw-r--r--Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
index 460809e93..5feac1adf 100644
--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
@@ -171,16 +171,29 @@ namespace Emby.Server.Implementations.AppBase
private void UpdateCachePath()
{
string cachePath;
-
+ // If the configuration file has no entry (i.e. not set in UI)
if (string.IsNullOrWhiteSpace(CommonConfiguration.CachePath))
{
- cachePath = null;
+ // If the current live configuration has no entry (i.e. not set on CLI/envvars, during startup)
+ if (string.IsNullOrWhiteSpace(((BaseApplicationPaths)CommonApplicationPaths).CachePath))
+ {
+ // Set cachePath to a default value under ProgramDataPath
+ cachePath = Path.Combine(((BaseApplicationPaths)CommonApplicationPaths).ProgramDataPath, "cache");
+ }
+ else
+ {
+ // Set cachePath to the existing live value; will require restart if UI value is removed (but not replaced)
+ // TODO: Figure out how to re-grab this from the CLI/envvars while running
+ cachePath = ((BaseApplicationPaths)CommonApplicationPaths).CachePath;
+ }
}
else
{
- cachePath = Path.Combine(CommonConfiguration.CachePath, "cache");
+ // Set cachePath to the new UI-set value
+ cachePath = CommonConfiguration.CachePath;
}
+ Logger.LogInformation("Setting cache path to " + cachePath);
((BaseApplicationPaths)CommonApplicationPaths).CachePath = cachePath;
}