From 60a49e3a03f13c5eca22f4d13ac72f085abf5062 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 14 Jul 2021 21:44:33 +0100 Subject: [PATCH] Fixed: Error getting candidates if parsed author is null --- .../BookImport/Identification/CandidateService.cs | 9 ++++++--- .../BookImport/Identification/IdentificationService.cs | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs index f5d3248db..71cd7004c 100644 --- a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs +++ b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/CandidateService.cs @@ -173,10 +173,13 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification { foreach (var authorTag in authorTags) { - var possibleAuthors = _authorService.GetCandidates(authorTag); - foreach (var author in possibleAuthors) + if (authorTag.IsNotNullOrWhiteSpace()) { - candidateReleases.AddRange(GetDbCandidatesByAuthor(localEdition, author, includeExisting)); + var possibleAuthors = _authorService.GetCandidates(authorTag); + foreach (var author in possibleAuthors) + { + candidateReleases.AddRange(GetDbCandidatesByAuthor(localEdition, author, includeExisting)); + } } } } diff --git a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/IdentificationService.cs b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/IdentificationService.cs index 533f45d21..e3e4daf61 100644 --- a/src/NzbDrone.Core/MediaFiles/BookImport/Identification/IdentificationService.cs +++ b/src/NzbDrone.Core/MediaFiles/BookImport/Identification/IdentificationService.cs @@ -81,6 +81,7 @@ namespace NzbDrone.Core.MediaFiles.BookImport.Identification { i++; _logger.ProgressInfo($"Identifying book {i}/{releases.Count}"); + _logger.Debug($"Identifying book files:\n{localRelease.LocalBooks.Select(x => x.Path).ConcatToString("\n")}"); IdentifyRelease(localRelease, idOverrides, config); }