瀏覽代碼

Changed the App.Config to longer break both nix (in debug mode) and windows (in release mode) profiles. Changed the Path helper library to replace %ApplicationData% in Windows land with the Userdata\roaming folder, and with /var/lib in nix land

Phallacy 6 年之前
父節點
當前提交
08024c81de
共有 2 個文件被更改,包括 12 次插入3 次删除
  1. 10 1
      MediaBrowser.Server.Mono/ApplicationPathHelper.cs
  2. 2 2
      MediaBrowser.Server.Mono/app.config

+ 10 - 1
MediaBrowser.Server.Mono/ApplicationPathHelper.cs

@@ -1,6 +1,7 @@
 using System;
 using System;
 using System.Configuration;
 using System.Configuration;
 using System.IO;
 using System.IO;
+using System.Runtime.InteropServices;
 
 
 namespace MediaBrowser.Server.Mono
 namespace MediaBrowser.Server.Mono
 {
 {
@@ -22,7 +23,15 @@ namespace MediaBrowser.Server.Mono
                 ConfigurationManager.AppSettings["DebugProgramDataPath"] : 
                 ConfigurationManager.AppSettings["DebugProgramDataPath"] : 
                 ConfigurationManager.AppSettings["ReleaseProgramDataPath"];
                 ConfigurationManager.AppSettings["ReleaseProgramDataPath"];
 
 
-            programDataPath = programDataPath.Replace("%ApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
+            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
             programDataPath = programDataPath
                 .Replace('/', Path.DirectorySeparatorChar)
                 .Replace('/', Path.DirectorySeparatorChar)

+ 2 - 2
MediaBrowser.Server.Mono/app.config

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <?xml version="1.0" encoding="utf-8" ?>
 <configuration>
 <configuration>
   <appSettings>
   <appSettings>
-    <add key="DebugProgramDataPath" value="E:\Temp" />
-    <add key="ReleaseProgramDataPath" value="/var/lib/emby/" />
+    <add key="DebugProgramDataPath" value="%ApplicationData%/jellyfin-debug/" />
+    <add key="ReleaseProgramDataPath" value="%ApplicationData%/jellyfin/" />
   </appSettings>
   </appSettings>
 </configuration>
 </configuration>