From 3afae968ebc72ad35abe07cfc4b84d7e243b1840 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 15 Jul 2024 12:03:53 -0700 Subject: [PATCH] Fixed: Import queue not processing after incomplete import --- src/NzbDrone.Core/Download/CompletedDownloadService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs index b157012d3..d22589c37 100644 --- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs +++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs @@ -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));