From e9b537b6e60a824ca59ef14f9ecd22d0c21cfe8b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 31 Jan 2020 17:25:44 -0800 Subject: [PATCH] Fixed: Rejecting import for a release that was grabbed again --- .../Specifications/AlreadyImportedSpecification.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/AlreadyImportedSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/AlreadyImportedSpecification.cs index ebcbe1aa2..0641e8cab 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/AlreadyImportedSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/AlreadyImportedSpecification.cs @@ -1,5 +1,6 @@ using System.Linq; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Download; using NzbDrone.Core.History; @@ -39,14 +40,18 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications var episodeHistory = _historyService.FindByEpisodeId(episode.Id); var lastImported = episodeHistory.FirstOrDefault(h => h.EventType == HistoryEventType.DownloadFolderImported); + var lastGrabbed = episodeHistory.FirstOrDefault(h => h.EventType == HistoryEventType.Grabbed); if (lastImported == null) { continue; } - // TODO: Ignore last imported check if the same release was grabbed again - // See: https://github.com/Sonarr/Sonarr/issues/2393 + // If the release was grabbed again after importing don't reject it + if (lastGrabbed != null && lastGrabbed.Date.After(lastImported.Date)) + { + continue; + } if (lastImported.DownloadId == downloadClientItem.DownloadId) {