diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-01 00:06:28 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-07-01 00:06:28 -0400 |
| commit | 43943657b7ea0c607f998c6397d3878e3fb05c5f (patch) | |
| tree | 3ac5009b82a2366bed09be8b0222a53a9c8c57de /MediaBrowser.Server.Implementations/Collections/CollectionManager.cs | |
| parent | f77209cf77aebd2ba8a8f35de41cbbaeaf36a47a (diff) | |
add additional view settings
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) |
