diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Collections/CollectionManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Collections/CollectionManager.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs index a69f9e94b..d9323573d 100644 --- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs +++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs @@ -4,13 +4,13 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; +using MoreLinq; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; -using MoreLinq; namespace MediaBrowser.Server.Implementations.Collections { @@ -27,6 +27,12 @@ namespace MediaBrowser.Server.Implementations.Collections _iLibraryMonitor = iLibraryMonitor; } + public Folder GetCollectionsFolder(string userId) + { + return _libraryManager.RootFolder.Children.Concat(_libraryManager.RootFolder.GetHiddenChildren()).OfType<ManualCollectionsFolder>() + .FirstOrDefault(); + } + public async Task<BoxSet> CreateCollection(CollectionCreationOptions options) { var name = options.Name; @@ -104,8 +110,7 @@ namespace MediaBrowser.Server.Implementations.Collections } } - return _libraryManager.RootFolder.Children.OfType<ManualCollectionsFolder>().FirstOrDefault() ?? - _libraryManager.RootFolder.GetHiddenChildren().OfType<ManualCollectionsFolder>().FirstOrDefault(); + return GetCollectionsFolder(string.Empty); } public async Task AddToCollection(Guid collectionId, IEnumerable<Guid> ids) |
