Merge pull request #55 from LogicalPhallacy/WindowsLibPathFix

Changed the App.Config to longer break both nix (in debug mode) and w…
This commit is contained in:
Joshua M. Boniface 2018-12-11 15:42:22 -05:00 committed by GitHub
commit 65d0d1d7b1
2 changed files with 12 additions and 3 deletions

View File

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

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<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>
</configuration>