diff options
Diffstat (limited to 'MediaBrowser.Common.Implementations')
3 files changed, 7 insertions, 40 deletions
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index eba8f5698..213942c9d 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -93,10 +93,6 @@ namespace MediaBrowser.Common.Implementations } /// <summary> - /// The _plugins path - /// </summary> - private string _pluginsPath; - /// <summary> /// Gets the path to the plugin directory /// </summary> /// <value>The plugins path.</value> @@ -104,21 +100,11 @@ namespace MediaBrowser.Common.Implementations { get { - if (_pluginsPath == null) - { - _pluginsPath = Path.Combine(ProgramDataPath, "plugins"); - Directory.CreateDirectory(_pluginsPath); - } - - return _pluginsPath; + return Path.Combine(ProgramDataPath, "plugins"); } } /// <summary> - /// The _plugin configurations path - /// </summary> - private string _pluginConfigurationsPath; - /// <summary> /// Gets the path to the plugin configurations directory /// </summary> /// <value>The plugin configurations path.</value> @@ -126,17 +112,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_pluginConfigurationsPath == null) - { - _pluginConfigurationsPath = Path.Combine(PluginsPath, "configurations"); - Directory.CreateDirectory(_pluginConfigurationsPath); - } - - return _pluginConfigurationsPath; + return Path.Combine(PluginsPath, "configurations"); } } - private string _tempUpdatePath; /// <summary> /// Gets the path to where temporary update files will be stored /// </summary> @@ -145,21 +124,11 @@ namespace MediaBrowser.Common.Implementations { get { - if (_tempUpdatePath == null) - { - _tempUpdatePath = Path.Combine(ProgramDataPath, "updates"); - Directory.CreateDirectory(_tempUpdatePath); - } - - return _tempUpdatePath; + return Path.Combine(ProgramDataPath, "updates"); } } /// <summary> - /// The _log directory path - /// </summary> - private string _logDirectoryPath; - /// <summary> /// Gets the path to the log directory /// </summary> /// <value>The log directory path.</value> @@ -167,12 +136,7 @@ namespace MediaBrowser.Common.Implementations { get { - if (_logDirectoryPath == null) - { - _logDirectoryPath = Path.Combine(ProgramDataPath, "logs"); - Directory.CreateDirectory(_logDirectoryPath); - } - return _logDirectoryPath; + return Path.Combine(ProgramDataPath, "logs"); } } diff --git a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs index 56f2b5e29..fb7fd1698 100644 --- a/MediaBrowser.Common.Implementations/Logging/NlogManager.cs +++ b/MediaBrowser.Common.Implementations/Logging/NlogManager.cs @@ -186,6 +186,8 @@ namespace MediaBrowser.Common.Implementations.Logging { LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Round(DateTime.Now.Ticks / 10000000) + ".log"); + Directory.CreateDirectory(Path.GetDirectoryName(LogFilePath)); + AddFileTarget(LogFilePath, level); LogSeverity = level; diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index 0581343d3..18462ba9b 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -528,6 +528,7 @@ namespace MediaBrowser.Common.Implementations.Updates // Success - move it to the real target try { + Directory.CreateDirectory(Path.GetDirectoryName(target)); File.Copy(tempFile, target, true); //If it is an archive - write out a version file so we know what it is if (isArchive) |
