1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

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

View File

@ -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));