diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index e3e0afcd8..4aaa4e9f3 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -13,6 +13,7 @@ using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Movies; using NzbDrone.Core.Movies.Events; using NzbDrone.Core.Parser; +using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.Download.TrackedDownloads { @@ -114,11 +115,9 @@ namespace NzbDrone.Core.Download.TrackedDownloads try { var historyItems = _historyService.FindByDownloadId(downloadItem.DownloadId) - .OrderByDescending(h => h.Date) - .ToList(); - var grabbedHistoryItem = historyItems.FirstOrDefault(h => h.EventType == MovieHistoryEventType.Grabbed); + .OrderByDescending(h => h.Date) + .ToList(); - // TODO: Create release info from history and use that here, so we don't loose indexer flags! var parsedMovieInfo = Parser.Parser.ParseMovieTitle(trackedDownload.DownloadItem.Title); if (parsedMovieInfo != null) @@ -155,6 +154,13 @@ namespace NzbDrone.Core.Download.TrackedDownloads firstHistoryItem.MovieId); } } + + if (trackedDownload.RemoteMovie != null && + Enum.TryParse(grabbedEvent?.Data?.GetValueOrDefault("indexerFlags"), true, out IndexerFlags flags)) + { + trackedDownload.RemoteMovie.Release ??= new ReleaseInfo(); + trackedDownload.RemoteMovie.Release.IndexerFlags = flags; + } } // Calculate custom formats