StartupHelper: fix app paths when SpecialFolder does not yet exists. (#12790)

This commit is contained in:
Tom Deseyn 2024-10-10 21:35:00 +02:00 committed by GitHub
parent 27ad11039c
commit 4492eb0e66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,7 @@ public static class StartupHelpers
var dataDir = options.DataDir var dataDir = options.DataDir
?? Environment.GetEnvironmentVariable("JELLYFIN_DATA_DIR") ?? Environment.GetEnvironmentVariable("JELLYFIN_DATA_DIR")
?? Path.Join( ?? Path.Join(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify),
"jellyfin"); "jellyfin");
var configDir = options.ConfigDir ?? Environment.GetEnvironmentVariable("JELLYFIN_CONFIG_DIR"); var configDir = options.ConfigDir ?? Environment.GetEnvironmentVariable("JELLYFIN_CONFIG_DIR");
@ -97,7 +97,7 @@ public static class StartupHelpers
{ {
// UNIX: $XDG_CONFIG_HOME // UNIX: $XDG_CONFIG_HOME
configDir = Path.Join( configDir = Path.Join(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.DoNotVerify),
"jellyfin"); "jellyfin");
} }
} }
@ -163,7 +163,7 @@ public static class StartupHelpers
if (cacheHome is null || !cacheHome.StartsWith('/')) if (cacheHome is null || !cacheHome.StartsWith('/'))
{ {
cacheHome = Path.Join( cacheHome = Path.Join(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify),
".cache"); ".cache");
} }