Fixed: Import queue not processing after incomplete import
This commit is contained in:
parent
c01abbf3b5
commit
3afae968eb
|
@ -235,8 +235,6 @@ namespace NzbDrone.Core.Download
|
||||||
|
|
||||||
var atLeastOneEpisodeImported = importResults.Any(c => c.Result == ImportResultType.Imported);
|
var atLeastOneEpisodeImported = importResults.Any(c => c.Result == ImportResultType.Imported);
|
||||||
var allEpisodesImportedInHistory = _trackedDownloadAlreadyImported.IsImported(trackedDownload, historyItems);
|
var allEpisodesImportedInHistory = _trackedDownloadAlreadyImported.IsImported(trackedDownload, historyItems);
|
||||||
var episodes = _episodeService.GetEpisodes(trackedDownload.RemoteEpisode.Episodes.Select(e => e.Id));
|
|
||||||
var files = _mediaFileService.GetFiles(episodes.Select(e => e.EpisodeFileId).Distinct());
|
|
||||||
|
|
||||||
if (allEpisodesImportedInHistory)
|
if (allEpisodesImportedInHistory)
|
||||||
{
|
{
|
||||||
|
@ -259,6 +257,9 @@ namespace NzbDrone.Core.Download
|
||||||
.Write();
|
.Write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var episodes = _episodeService.GetEpisodes(trackedDownload.RemoteEpisode.Episodes.Select(e => e.Id));
|
||||||
|
var files = _mediaFileService.GetFiles(episodes.Select(e => e.EpisodeFileId).Where(i => i > 0).Distinct());
|
||||||
|
|
||||||
trackedDownload.State = TrackedDownloadState.Imported;
|
trackedDownload.State = TrackedDownloadState.Imported;
|
||||||
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload, trackedDownload.RemoteEpisode.Series.Id, files, releaseInfo));
|
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload, trackedDownload.RemoteEpisode.Series.Id, files, releaseInfo));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue