From 364fbb9e0c7586afa296ddd7d739df086f4c3533 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Mon, 25 Feb 2013 00:17:59 -0500 Subject: fixed plugin assembly downloads as well as debug/release detection with nuget assemblies --- .../BaseApplicationPaths.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Common.Implementations/BaseApplicationPaths.cs') diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index f38013d00..e7abad1a4 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -12,6 +12,20 @@ namespace MediaBrowser.Common.Implementations /// public abstract class BaseApplicationPaths : IApplicationPaths { + /// + /// The _use debug path + /// + private bool _useDebugPath; + + /// + /// Initializes a new instance of the class. + /// + /// if set to true [use debug paths]. + protected BaseApplicationPaths(bool useDebugPath) + { + _useDebugPath = useDebugPath; + } + /// /// The _program data path /// @@ -272,14 +286,9 @@ namespace MediaBrowser.Common.Implementations /// Gets the path to the application's ProgramDataFolder /// /// System.String. - public static string GetProgramDataPath() + private string GetProgramDataPath() { -#if DEBUG - string programDataPath = ConfigurationManager.AppSettings["DebugProgramDataPath"]; - -#else - string programDataPath = Path.Combine(ConfigurationManager.AppSettings["ReleaseProgramDataPath"], ConfigurationManager.AppSettings["ProgramDataFolderName"]); -#endif + var programDataPath = _useDebugPath ? ConfigurationManager.AppSettings["DebugProgramDataPath"] : Path.Combine(ConfigurationManager.AppSettings["ReleaseProgramDataPath"], ConfigurationManager.AppSettings["ProgramDataFolderName"]); programDataPath = programDataPath.Replace("%CommonApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)); -- cgit v1.2.3