Fixed: Import queue not processing after incomplete import

This commit is contained in:
Mark McDowall 2024-07-15 12:03:53 -07:00 committed by GitHub
parent c01abbf3b5
commit 3afae968eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -235,8 +235,6 @@ namespace NzbDrone.Core.Download
var atLeastOneEpisodeImported = importResults.Any(c => c.Result == ImportResultType.Imported);
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)
{
@ -259,6 +257,9 @@ namespace NzbDrone.Core.Download
.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;
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload, trackedDownload.RemoteEpisode.Series.Id, files, releaseInfo));