diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-04 11:20:44 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-04 11:20:44 -0500 |
| commit | f1a7d9064063d1cc73a0fe9ed3f1fd9b5f5b5f55 (patch) | |
| tree | 8a6025c4ab086da29aa9da6b24d81d9b8dd68c5d /MediaBrowser.Api/Library/LibraryHelpers.cs | |
| parent | 4bbe8acb5cfc5c4a0c392db71d2858589c8f345f (diff) | |
fix scan stopping and restarting itself multiple times when adding/removing collections
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryHelpers.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryHelpers.cs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs index 3d0dd4e08..8f6dcfc0d 100644 --- a/MediaBrowser.Api/Library/LibraryHelpers.cs +++ b/MediaBrowser.Api/Library/LibraryHelpers.cs @@ -1,7 +1,6 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.IO; using System; using System.IO; using System.Linq; @@ -23,57 +22,6 @@ namespace MediaBrowser.Api.Library private const string ShortcutFileSearch = "*" + ShortcutFileExtension; /// <summary> - /// Adds the virtual folder. - /// </summary> - /// <param name="fileSystem">The file system.</param> - /// <param name="name">The name.</param> - /// <param name="collectionType">Type of the collection.</param> - /// <param name="user">The user.</param> - /// <param name="appPaths">The app paths.</param> - /// <exception cref="System.ArgumentException">There is already a media collection with the name + name + .</exception> - public static void AddVirtualFolder(IFileSystem fileSystem, string name, string collectionType, User user, IServerApplicationPaths appPaths) - { - name = fileSystem.GetValidFilename(name); - - var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath; - var virtualFolderPath = Path.Combine(rootFolderPath, name); - - if (Directory.Exists(virtualFolderPath)) - { - throw new ArgumentException("There is already a media collection with the name " + name + "."); - } - - Directory.CreateDirectory(virtualFolderPath); - - if (!string.IsNullOrEmpty(collectionType)) - { - var path = Path.Combine(virtualFolderPath, collectionType + ".collection"); - - File.Create(path); - } - } - - /// <summary> - /// Removes the virtual folder. - /// </summary> - /// <param name="name">The name.</param> - /// <param name="user">The user.</param> - /// <param name="appPaths">The app paths.</param> - /// <exception cref="System.IO.DirectoryNotFoundException">The media folder does not exist</exception> - public static void RemoveVirtualFolder(string name, User user, IServerApplicationPaths appPaths) - { - var rootFolderPath = user != null ? user.RootFolderPath : appPaths.DefaultUserViewsPath; - var path = Path.Combine(rootFolderPath, name); - - if (!Directory.Exists(path)) - { - throw new DirectoryNotFoundException("The media folder does not exist"); - } - - Directory.Delete(path, true); - } - - /// <summary> /// Renames the virtual folder. /// </summary> /// <param name="name">The name.</param> |
