|
|
@ -12,6 +12,20 @@ namespace MediaBrowser.Common.Implementations
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public abstract class BaseApplicationPaths : IApplicationPaths
|
|
|
|
public abstract class BaseApplicationPaths : IApplicationPaths
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// The _use debug path
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
private bool _useDebugPath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="useDebugPath">if set to <c>true</c> [use debug paths].</param>
|
|
|
|
|
|
|
|
protected BaseApplicationPaths(bool useDebugPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_useDebugPath = useDebugPath;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// The _program data path
|
|
|
|
/// The _program data path
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -272,14 +286,9 @@ namespace MediaBrowser.Common.Implementations
|
|
|
|
/// Gets the path to the application's ProgramDataFolder
|
|
|
|
/// Gets the path to the application's ProgramDataFolder
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
public static string GetProgramDataPath()
|
|
|
|
private string GetProgramDataPath()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if DEBUG
|
|
|
|
var programDataPath = _useDebugPath ? ConfigurationManager.AppSettings["DebugProgramDataPath"] : Path.Combine(ConfigurationManager.AppSettings["ReleaseProgramDataPath"], ConfigurationManager.AppSettings["ProgramDataFolderName"]);
|
|
|
|
string programDataPath = ConfigurationManager.AppSettings["DebugProgramDataPath"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
string programDataPath = Path.Combine(ConfigurationManager.AppSettings["ReleaseProgramDataPath"], ConfigurationManager.AppSettings["ProgramDataFolderName"]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
programDataPath = programDataPath.Replace("%CommonApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData));
|
|
|
|
programDataPath = programDataPath.Replace("%CommonApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData));
|
|
|
|
|
|
|
|
|
|
|
|