diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-04 12:48:23 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-06-04 12:48:23 -0400 |
| commit | 2e408e40c015b34b365d0e0ef4d7a20fc02b0b80 (patch) | |
| tree | 99c8ead78374aec26ad993fb94b7b76bb908db92 /MediaBrowser.Controller/Entities/User.cs | |
| parent | 02fedead11f738c09e503c3bdc74e2dd98e21cc8 (diff) | |
defer path creation when possible
Diffstat (limited to 'MediaBrowser.Controller/Entities/User.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/User.cs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 65884332a..e991820e3 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; } } |
