From 027ed1335f01972d672d28edfb5b2fa469354c87 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 18 Nov 2014 23:49:00 -0800 Subject: [PATCH] Workaround to deal with updating scene names --- src/NzbDrone.Core/Download/DownloadTrackingService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Download/DownloadTrackingService.cs b/src/NzbDrone.Core/Download/DownloadTrackingService.cs index 6038f2f13..db119f0f4 100644 --- a/src/NzbDrone.Core/Download/DownloadTrackingService.cs +++ b/src/NzbDrone.Core/Download/DownloadTrackingService.cs @@ -91,8 +91,7 @@ public void MarkAsFailed(Int32 historyId) var item = _historyService.Get(historyId); var trackedDownload = GetTrackedDownloads() - .Where(h => h.DownloadItem.DownloadClientId.Equals(item.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID))) - .FirstOrDefault(); + .FirstOrDefault(h => h.DownloadItem.DownloadClientId.Equals(item.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID))); if (trackedDownload != null && trackedDownload.State == TrackedDownloadState.Unknown) { @@ -144,7 +143,8 @@ private Boolean UpdateTrackedDownloads(List grabbedHistory) if (newTrackedDownloads.ContainsKey(trackingId)) continue; - if (!oldTrackedDownloads.TryGetValue(trackingId, out trackedDownload)) + //TODO: Rebuilding the tracked download when it is a warning is a total hack to deal with updated scene mappings + if (!oldTrackedDownloads.TryGetValue(trackingId, out trackedDownload) || trackedDownload.Status == TrackedDownloadStatus.Warning) { trackedDownload = GetTrackedDownload(trackingId, downloadClient.Definition.Id, downloadItem, grabbedHistory);