Fixed: Don't repeatedly refresh queue when author deleted

This commit is contained in:
ta264 2021-09-02 21:12:14 +01:00
parent 3c4c6b855e
commit 8b19f02ade

View file

@ -56,18 +56,21 @@ public void UpdateBookCache(int bookId)
{
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;
_eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads()));
if (parsedBookInfo != null)
{
item.RemoteBook = _parsingService.Map(parsedBookInfo);
}
}
_eventAggregator.PublishEvent(new TrackedDownloadRefreshedEvent(GetTrackedDownloads()));
}
}
public void StopTracking(string downloadId)