From 7cd41a6ed62c46006307add9de92e0b329bd0edc Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Feb 2014 00:04:11 -0500 Subject: easier user library setup --- MediaBrowser.Api/Library/LibraryHelpers.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Api/Library/LibraryHelpers.cs') diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs index 3836a0860..be9f00a61 100644 --- a/MediaBrowser.Api/Library/LibraryHelpers.cs +++ b/MediaBrowser.Api/Library/LibraryHelpers.cs @@ -1,6 +1,5 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller; -using MediaBrowser.Controller.Entities; using System; using System.IO; using System.Linq; @@ -27,12 +26,11 @@ namespace MediaBrowser.Api.Library /// The file system. /// Name of the virtual folder. /// The media path. - /// The user. /// The app paths. /// The media folder does not exist - public static void RemoveMediaPath(IFileSystem fileSystem, string virtualFolderName, string mediaPath, User user, IServerApplicationPaths appPaths) + public static void RemoveMediaPath(IFileSystem fileSystem, string virtualFolderName, string mediaPath, IServerApplicationPaths appPaths) { - var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath; + var rootFolderPath = appPaths.DefaultUserViewsPath; var path = Path.Combine(rootFolderPath, virtualFolderName); if (!Directory.Exists(path)) @@ -54,18 +52,17 @@ namespace MediaBrowser.Api.Library /// The file system. /// Name of the virtual folder. /// The path. - /// The user. /// The app paths. - /// The path is not valid. /// The path does not exist. - public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, User user, IServerApplicationPaths appPaths) + /// The path is not valid. + public static void AddMediaPath(IFileSystem fileSystem, string virtualFolderName, string path, IServerApplicationPaths appPaths) { if (!Directory.Exists(path)) { throw new DirectoryNotFoundException("The path does not exist."); } - var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath; + var rootFolderPath = appPaths.DefaultUserViewsPath; var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName); var shortcutFilename = Path.GetFileNameWithoutExtension(path); -- cgit v1.2.3