From 938b69b240f7ceecec90bbb55402567a805f3349 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 26 Jul 2023 11:36:59 +0300 Subject: [PATCH] Fixed: Add dedupe releases rule based on indexer priority --- src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs index 9fd495a4f..4d4d4023d 100644 --- a/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/ReleaseSearchService.cs @@ -143,8 +143,10 @@ namespace NzbDrone.Core.IndexerSearch private List DeDupeDecisions(List decisions) { - // De-dupe reports by guid so duplicate results aren't returned. Pick the one with the least rejections. - return decisions.GroupBy(d => d.RemoteMovie.Release.Guid).Select(d => d.OrderBy(v => v.Rejections.Count()).First()).ToList(); + // De-dupe reports by guid so duplicate results aren't returned. Pick the one with the least rejections and higher indexer priority. + return decisions.GroupBy(d => d.RemoteMovie.Release.Guid) + .Select(d => d.OrderBy(v => v.Rejections.Count()).ThenBy(v => v.RemoteMovie?.Release?.IndexerPriority ?? 100).First()) + .ToList(); } } }