diff options
| author | Bond_009 <bond.009@outlook.com> | 2018-12-12 18:55:14 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2018-12-13 11:33:27 +0100 |
| commit | 0f5c0cca3768efd106192add90090c893b2ea60c (patch) | |
| tree | 7d8e6a30f8a276d7bdb652630db5903b881bc363 /MediaBrowser.Server.Mono/ApplicationPathHelper.cs | |
| parent | b36b526f27ebd9ac716d743eea26e65407ceeea4 (diff) | |
Move default folder for *nix platforms to $HOME/.jellyfin
Remove dependency on System.Configuration.ConfigurationManager
Diffstat (limited to 'MediaBrowser.Server.Mono/ApplicationPathHelper.cs')
| -rw-r--r-- | MediaBrowser.Server.Mono/ApplicationPathHelper.cs | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs b/MediaBrowser.Server.Mono/ApplicationPathHelper.cs deleted file mode 100644 index ac55693fa..000000000 --- a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Configuration; -using System.IO; -using System.Runtime.InteropServices; - -namespace MediaBrowser.Server.Mono -{ - public static class ApplicationPathHelper - { - /// <summary> - /// Gets the path to the application's ProgramDataFolder - /// </summary> - /// <returns>System.String.</returns> - public static string GetProgramDataPath(string applicationPath) - { - var useDebugPath = false; - -#if DEBUG - useDebugPath = true; -#endif - - var programDataPath = useDebugPath ? - ConfigurationManager.AppSettings["DebugProgramDataPath"] : - ConfigurationManager.AppSettings["ReleaseProgramDataPath"]; - - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - programDataPath = programDataPath.Replace("%ApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); - } - else - { - programDataPath = programDataPath.Replace("%ApplicationData%", "/var/lib"); - } - - - programDataPath = programDataPath - .Replace('/', Path.DirectorySeparatorChar) - .Replace('\\', Path.DirectorySeparatorChar); - - // If it's a relative path, e.g. "..\" - if (!Path.IsPathRooted(programDataPath)) - { - var path = Path.GetDirectoryName(applicationPath); - - if (string.IsNullOrEmpty(path)) - { - throw new ApplicationException("Unable to determine running assembly location"); - } - - programDataPath = Path.Combine(path, programDataPath); - - programDataPath = Path.GetFullPath(programDataPath); - } - - Directory.CreateDirectory(programDataPath); - - return programDataPath; - } - } -} |
