From 34506025accc73266868d207744bfcfba2e4965b Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 19 Jan 2022 21:38:37 +0000 Subject: [PATCH] Fixed: Better searching for local candidate editions --- src/NzbDrone.Core/Books/Repositories/EditionRepository.cs | 3 ++- .../MediaFiles/BookImport/Identification/CandidateService.cs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Books/Repositories/EditionRepository.cs b/src/NzbDrone.Core/Books/Repositories/EditionRepository.cs index 3a49ead6c..89b31fc45 100644 --- a/src/NzbDrone.Core/Books/Repositories/EditionRepository.cs +++ b/src/NzbDrone.Core/Books/Repositories/EditionRepository.cs @@ -78,7 +78,8 @@ namespace NzbDrone.Core.Books if (onlyMonitored) { - builder = builder.Where(e => e.Monitored == true); + builder = builder.OrWhere(e => e.Monitored == true); + builder = builder.OrWhere(b => b.AnyEditionOk == true); } return Query(builder); diff --git a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs index dba364968..b88444dab 100644 --- a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs +++ b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs @@ -147,6 +147,9 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification { candidateReleases.AddRange(GetDbCandidatesByBook(book, includeExisting)); } + + var possibleEditions = _editionService.GetCandidates(author.AuthorMetadataId, bookTag); + candidateReleases.AddRange(GetDbCandidatesByEdition(possibleEditions, includeExisting)); } return candidateReleases;