1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Mark completed imports based on history as imported to remove from queue

Fixes #4994
This commit is contained in:
Qstick 2020-09-11 22:27:29 -04:00
parent 7ddaca06a6
commit 4be83a3367

View File

@ -170,15 +170,14 @@ public bool VerifyImport(TrackedDownload trackedDownload, List<ImportResult> imp
if (allMoviesImportedInHistory)
{
// Log different error messages depending on the circumstances, but treat both as fully imported, because that's the reality.
// The second message shouldn't be logged in most cases, but continued reporting would indicate an ongoing issue.
if (atLeastOneMovieImported)
{
_logger.Debug("All movies were imported in history for {0}", trackedDownload.DownloadItem.Title);
trackedDownload.State = TrackedDownloadState.Imported;
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload, trackedDownload.RemoteMovie.Movie.Id));
return true;
}
else
{
_logger.Debug()
.Message("No Movies were just imported, but all movies were previously imported, possible issue with download history.")
.Property("MovieId", trackedDownload.RemoteMovie.Movie.Id)
@ -189,6 +188,12 @@ public bool VerifyImport(TrackedDownload trackedDownload, List<ImportResult> imp
.Write();
}
trackedDownload.State = TrackedDownloadState.Imported;
_eventAggregator.PublishEvent(new DownloadCompletedEvent(trackedDownload, trackedDownload.RemoteMovie.Movie.Id));
return true;
}
_logger.Debug("Not all movies have been imported for {0}", trackedDownload.DownloadItem.Title);
return false;
}