defer path creation when possible

This commit is contained in:
Luke Pulverenti
2013-06-04 12:48:23 -04:00
parent 02fedead11
commit 2e408e40c0
7 changed files with 38 additions and 233 deletions

View File

@@ -28,19 +28,14 @@ namespace MediaBrowser.Controller.Entities
{
get
{
if (Configuration.UseCustomLibrary)
var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
if (!Directory.Exists(path))
{
var rootFolderPath = GetRootFolderPath(Name);
if (!Directory.Exists(rootFolderPath))
{
Directory.CreateDirectory(rootFolderPath);
}
return rootFolderPath;
Directory.CreateDirectory(path);
}
return ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
return path;
}
}