1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-15 10:39:47 +02:00

Fixed: Manual imports of multi-episode files being treated as fully imported

This commit is contained in:
Mark McDowall 2020-04-25 14:13:29 -07:00
parent 79d8a9d44b
commit 417340c2c6

View File

@ -364,7 +364,12 @@ public void Execute(ManualImportCommand message)
}
}
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));