From 2e408e40c015b34b365d0e0ef4d7a20fc02b0b80 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 4 Jun 2013 12:48:23 -0400 Subject: defer path creation when possible --- MediaBrowser.Controller/Entities/User.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 65884332aa..e991820e3e 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -28,19 +28,14 @@ namespace MediaBrowser.Controller.Entities { get { - if (Configuration.UseCustomLibrary) - { - var rootFolderPath = GetRootFolderPath(Name); + var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; - if (!Directory.Exists(rootFolderPath)) - { - Directory.CreateDirectory(rootFolderPath); - } - - return rootFolderPath; + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); } - return ConfigurationManager.ApplicationPaths.DefaultUserViewsPath; + return path; } } -- cgit v1.2.3