aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-02-16 17:03:15 +0100
committerGitHub <noreply@github.com>2019-02-16 17:03:15 +0100
commitbdfd042d705ec25ef37516ea7495f71eaee53d2e (patch)
tree463809b0be8f2a8995ca7648f2425d19c3bfa8a7 /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
parenta6a4cd5667fbb5a793cb9e551ce9c9a9bfb0d44b (diff)
parent25c2267a89af5c2e82774c638cdad0defcc894b5 (diff)
Merge branch 'master' into fields
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 d7fa4d4c2..af60a8dce 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;
}