From 0f5c0cca3768efd106192add90090c893b2ea60c Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 12 Dec 2018 18:55:14 +0100 Subject: Move default folder for *nix platforms to $HOME/.jellyfin Remove dependency on System.Configuration.ConfigurationManager --- MediaBrowser.Server.Mono/Program.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Mono/Program.cs') diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 3bcfff9831..8d0c9ee0ee 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -24,6 +24,7 @@ using Mono.Unix.Native; using ILogger = MediaBrowser.Model.Logging.ILogger; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; using System.Threading; +using InteropServices = System.Runtime.InteropServices; namespace MediaBrowser.Server.Mono { @@ -87,12 +88,19 @@ namespace MediaBrowser.Server.Mono { if (string.IsNullOrEmpty(programDataPath)) { - programDataPath = ApplicationPathHelper.GetProgramDataPath(applicationPath); + if (InteropServices.RuntimeInformation.IsOSPlatform(InteropServices.OSPlatform.Windows)) + { + programDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "jellyfin"); + } + else + { + programDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".jellyfin"); + } } var appFolderPath = Path.GetDirectoryName(applicationPath); - return new ServerApplicationPaths(programDataPath, appFolderPath, Path.GetDirectoryName(applicationPath)); + return new ServerApplicationPaths(programDataPath, appFolderPath, appFolderPath); } private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options) -- cgit v1.2.3