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

@@ -558,6 +558,12 @@ namespace MediaBrowser.Server.Implementations.Library
public AggregateFolder CreateRootFolder()
{
var rootFolderPath = ConfigurationManager.ApplicationPaths.RootFolderPath;
if (!Directory.Exists(rootFolderPath))
{
Directory.CreateDirectory(rootFolderPath);
}
var rootFolder = RetrieveItem(rootFolderPath.GetMBId(typeof(AggregateFolder))) as AggregateFolder ?? (AggregateFolder)ResolvePath(rootFolderPath);
// Add in the plug-in folders