From 3488cfecbd54eaaf917d853664f68cac84d472e9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 29 Dec 2013 09:12:29 -0500 Subject: make lazy loaded paths more nimble --- .../BaseApplicationPaths.cs | 44 ++-------------------- 1 file changed, 4 insertions(+), 40 deletions(-) (limited to 'MediaBrowser.Common.Implementations/BaseApplicationPaths.cs') 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 @@ -92,10 +92,6 @@ namespace MediaBrowser.Common.Implementations } } - /// - /// The _plugins path - /// - private string _pluginsPath; /// /// Gets the path to the plugin directory /// @@ -104,20 +100,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_pluginsPath == null) - { - _pluginsPath = Path.Combine(ProgramDataPath, "plugins"); - Directory.CreateDirectory(_pluginsPath); - } - - return _pluginsPath; + return Path.Combine(ProgramDataPath, "plugins"); } } - /// - /// The _plugin configurations path - /// - private string _pluginConfigurationsPath; /// /// Gets the path to the plugin configurations directory /// @@ -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; /// /// Gets the path to where temporary update files will be stored /// @@ -145,20 +124,10 @@ namespace MediaBrowser.Common.Implementations { get { - if (_tempUpdatePath == null) - { - _tempUpdatePath = Path.Combine(ProgramDataPath, "updates"); - Directory.CreateDirectory(_tempUpdatePath); - } - - return _tempUpdatePath; + return Path.Combine(ProgramDataPath, "updates"); } } - /// - /// The _log directory path - /// - private string _logDirectoryPath; /// /// Gets the path to the log directory /// @@ -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"); } } -- cgit v1.2.3