Skip to content

The Free Software Media System - Server Backend & API

Fix duplicated movies when group movies into collections is enabled

Mister Rajoy18cd634ec831
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs
index 1ab2bdfbe8..449f8872fd 100644
--- a/Emby.Server.Implementations/Collections/CollectionManager.cs
+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs
@@ -344,7 +344,20 @@ namespace Emby.Server.Implementations.Collections
}
else
{
- results[item.Id] = item;
+ var alreadyInResults = false;
+ foreach (var child in item.GetMediaSources(true))
+ {
+
+ if (results.ContainsKey(Guid.Parse(child.Id)))
+ {
+ alreadyInResults = true;
+ }
+ }
+ if (!alreadyInResults)
+ {
+
+ results[item.Id] = item;
+ }
}
}
}