diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-03-14 13:37:00 +0100 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2021-03-21 19:08:26 -0400 |
| commit | da3b7bb6840f99e17e47b4e0d9844445f8361122 (patch) | |
| tree | b4d892f7bc9dd178dde99269198c2528ebe3b4b9 | |
| parent | 4a320b26b55aa86c1cadd28e9d37c6a0ead7042e (diff) | |
Merge pull request #5324 from danieladov/master
Fix duplicated movies when group movies into collections is enabled
(cherry picked from commit bd70f562189e81d409caf2f4f67d8d495d4bbf1e)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | Emby.Server.Implementations/Collections/CollectionManager.cs | 15 |
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; + } } } } |
