aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-01-06 15:26:01 -0500
committerGitHub <noreply@github.com>2019-01-06 15:26:01 -0500
commit423ad4a20bccd54f07f12993f3ee220193b792f7 (patch)
tree7e88f10cb1993322f0386dd9da58c9782870dc96 /Jellyfin.Server/Program.cs
parent1273da5af91cf062bbf9480ba09e502c38c17d1d (diff)
parent5623d4b63217cf5d786f0c9ac5407d7b3e6d8831 (diff)
Merge pull request #450 from Bond-009/config
BaseApplicationPaths set up default config and log dir paths
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs28
1 files changed, 6 insertions, 22 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index e9f4708c8..d74315755 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -46,6 +46,8 @@ namespace Jellyfin.Server
}
ServerApplicationPaths appPaths = createApplicationPaths(options);
+ // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
+ Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
await createLogger(appPaths);
_loggerFactory = new SerilogLoggerFactory();
_logger = _loggerFactory.CreateLogger("Main");
@@ -138,23 +140,8 @@ namespace Jellyfin.Server
}
else
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- configDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
- }
- else
- {
- // $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored.
- configDir = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME");
- // If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config should be used.
- if (string.IsNullOrEmpty(configDir))
- {
- configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share");
- }
- }
- configDir = Path.Combine(configDir, "jellyfin");
- // Ensure the dir exists
- Directory.CreateDirectory(configDir);
+ // Let BaseApplicationPaths set up the default value
+ configDir = null;
}
}
@@ -167,12 +154,9 @@ namespace Jellyfin.Server
}
else
{
- logDir = Path.Combine(programDataPath, "logs");
- // Ensure the dir exists
- Directory.CreateDirectory(logDir);
+ // Let BaseApplicationPaths set up the default value
+ logDir = null;
}
- // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
- Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", logDir);
}
string appPath = AppContext.BaseDirectory;