aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-03-14 13:37:00 +0100
committerGitHub <noreply@github.com>2021-03-14 13:37:00 +0100
commitbd70f562189e81d409caf2f4f67d8d495d4bbf1e (patch)
tree7242c2a2f4c9ec6dda1535641fd9c852a1ff2871
parent0e5d4a3bcfaa07c3cd1c0085a5940b1c13f1ae20 (diff)
parent8883aa4a375db4e573fc3f10fcb95e5c145ea450 (diff)
Merge pull request #5324 from danieladov/master
Fix duplicated movies when group movies into collections is enabled
-rw-r--r--Emby.Server.Implementations/Collections/CollectionManager.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs
index 1ab2bdfbe..db532ce5b 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 (Guid.TryParse(child.Id, out var id) && results.ContainsKey(id))
+ {
+ alreadyInResults = true;
+ break;
+ }
+ }
+
+ if (!alreadyInResults)
+ {
+ results[item.Id] = item;
+ }
}
}
}