Fix: consider download completed if all remote episodes are imported

This commit is contained in:
Keivan Beigi
2014-12-22 11:25:23 -08:00
parent 2193e34537
commit 4ac9fd939a
2 changed files with 40 additions and 6 deletions

View File

@@ -79,6 +79,13 @@ namespace NzbDrone.Core.Download
return;
}
if (importResults.Count(c => c.Result == ImportResultType.Imported) >= trackedDownload.RemoteEpisode.Episodes.Count)
{
trackedDownload.State = TrackedDownloadStage.Imported;
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload));
return;
}
if (importResults.Any(c => c.Result != ImportResultType.Imported))
{
var statusMessages = importResults
@@ -87,12 +94,8 @@ namespace NzbDrone.Core.Download
.ToArray();
trackedDownload.Warn(statusMessages);
return;
}
trackedDownload.State = TrackedDownloadStage.Imported;
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload));
}
}
}