diff options
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 03fdacb26..d74315755 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -13,7 +13,6 @@ using Emby.Server.Implementations; using Emby.Server.Implementations.EnvironmentInfo;
using Emby.Server.Implementations.IO;
using Emby.Server.Implementations.Networking;
-using Jellyfin.Server.Native;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Drawing;
@@ -47,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");
@@ -71,7 +72,6 @@ namespace Jellyfin.Server _loggerFactory,
options,
fileSystem,
- new PowerManagement(),
environmentInfo,
new NullImageEncoder(),
new SystemEvents(_loggerFactory.CreateLogger("SystemEvents")),
@@ -140,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;
}
}
@@ -169,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;
@@ -274,7 +256,7 @@ namespace Jellyfin.Server }
}
- public static void Shutdown()
+ public static void Shutdown()
{
ApplicationTaskCompletionSource.SetResult(true);
}
|
