aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Collections/CollectionManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Collections/CollectionManager.cs')
-rw-r--r--Emby.Server.Implementations/Collections/CollectionManager.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs
index 4e5d344a3..5b168f6cc 100644
--- a/Emby.Server.Implementations/Collections/CollectionManager.cs
+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs
@@ -12,6 +12,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Extensions;
namespace Emby.Server.Implementations.Collections
{
@@ -190,7 +191,9 @@ namespace Emby.Server.Implementations.Collections
if (list.Count > 0)
{
- collection.LinkedChildren.AddRange(list);
+ var newList = collection.LinkedChildren.ToList();
+ newList.AddRange(list);
+ collection.LinkedChildren = newList.ToArray(newList.Count);
collection.UpdateRatingToContent();
@@ -241,9 +244,9 @@ namespace Emby.Server.Implementations.Collections
}
}
- foreach (var child in list)
+ if (list.Count > 0)
{
- collection.LinkedChildren.Remove(child);
+ collection.LinkedChildren = collection.LinkedChildren.Except(list).ToArray();
}
collection.UpdateRatingToContent();