From 417340c2c66038948d3bc9175a51bc65c4477ed7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 25 Apr 2020 14:13:29 -0700 Subject: [PATCH] Fixed: Manual imports of multi-episode files being treated as fully imported --- .../MediaFiles/EpisodeImport/Manual/ManualImportService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs index c86444059..464d7e9a1 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs @@ -364,7 +364,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Manual } } - if (groupedTrackedDownload.Select(c => c.ImportResult).Count(c => c.Result == ImportResultType.Imported) >= Math.Max(1, trackedDownload.RemoteEpisode.Episodes.Count)) + var allEpisodesImported = groupedTrackedDownload.Select(c => c.ImportResult) + .Where(c => c.Result == ImportResultType.Imported) + .SelectMany(c => c.ImportDecision.LocalEpisode.Episodes).Count() >= + Math.Max(1, trackedDownload.RemoteEpisode.Episodes.Count); + + if (allEpisodesImported) { trackedDownload.State = TrackedDownloadState.Imported; _eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload));