aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Collections/CollectionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Collections/CollectionManager.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
index 6100e3f5d..faf73c059 100644
--- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
+++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
@@ -6,7 +6,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
-using MoreLinq;
using System;
using System.Collections.Generic;
using System.IO;
@@ -41,6 +40,14 @@ namespace MediaBrowser.Server.Implementations.Collections
.FirstOrDefault();
}
+ public IEnumerable<BoxSet> GetCollections(User user)
+ {
+ var folder = GetCollectionsFolder(user.Id.ToString("N"));
+ return folder == null ?
+ new List<BoxSet>() :
+ folder.GetChildren(user, true).OfType<BoxSet>();
+ }
+
public async Task<BoxSet> CreateCollection(CollectionCreationOptions options)
{
var name = options.Name;
@@ -269,7 +276,8 @@ namespace MediaBrowser.Server.Implementations.Collections
public IEnumerable<BaseItem> CollapseItemsWithinBoxSets(IEnumerable<BaseItem> items, User user)
{
var results = new Dictionary<Guid, BaseItem>();
- var allBoxsets = new List<BoxSet>();
+
+ var allBoxsets = GetCollections(user).ToList();
foreach (var item in items)
{