From 8b19f02ade066a55f7156fd2b3795c20333e448a Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 2 Sep 2021 21:12:14 +0100 Subject: [PATCH] Fixed: Don't repeatedly refresh queue when author deleted --- .../TrackedDownloadService.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index 932996f90..a6138164a 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -56,18 +56,21 @@ namespace NzbDrone.Core.Download.TrackedDownloads { var updateCacheItems = _cache.Values.Where(x => x.RemoteBook != null && x.RemoteBook.Books.Any(a => a.Id == bookId)).ToList(); - foreach (var item in updateCacheItems) + if (updateCacheItems.Any()) { - var parsedBookInfo = Parser.Parser.ParseBookTitle(item.DownloadItem.Title); - item.RemoteBook = null; - - if (parsedBookInfo != null) + foreach (var item in updateCacheItems) { - item.RemoteBook = _parsingService.Map(parsedBookInfo); + var parsedBookInfo = Parser.Parser.ParseBookTitle(item.DownloadItem.Title); + item.RemoteBook = null; + + if (parsedBookInfo != null) + { + item.RemoteBook = _parsingService.Map(parsedBookInfo); + } } - } - _eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads())); + _eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads())); + } } public void StopTracking(string downloadId)