mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Blacklisting will trigger episode search
This commit is contained in:
parent
68e40bca29
commit
8520fe3e0c
12 changed files with 197 additions and 48 deletions
|
@ -41,15 +41,15 @@ namespace NzbDrone.Core.Download
|
|||
return;
|
||||
}
|
||||
|
||||
var recentHistory = _historyService.BetweenDates(DateTime.UtcNow.AddDays(-1), DateTime.UtcNow, HistoryEventType.Grabbed);
|
||||
var grabbedHistory = _historyService.Grabbed();
|
||||
var failedHistory = _historyService.Failed();
|
||||
|
||||
foreach (var failedItem in failedItems)
|
||||
{
|
||||
var failedLocal = failedItem;
|
||||
var historyItems = recentHistory.Where(h => h.Data.ContainsKey(DOWNLOAD_CLIENT) &&
|
||||
h.Data[DOWNLOAD_CLIENT_ID].Equals(failedLocal.Id))
|
||||
.ToList();
|
||||
var historyItems = grabbedHistory.Where(h => h.Data.ContainsKey(DOWNLOAD_CLIENT) &&
|
||||
h.Data[DOWNLOAD_CLIENT_ID].Equals(failedLocal.Id))
|
||||
.ToList();
|
||||
|
||||
if (!historyItems.Any())
|
||||
{
|
||||
|
@ -64,18 +64,17 @@ namespace NzbDrone.Core.Download
|
|||
continue;
|
||||
}
|
||||
|
||||
foreach (var historyItem in historyItems)
|
||||
var historyItem = historyItems.First();
|
||||
|
||||
_eventAggregator.PublishEvent(new DownloadFailedEvent
|
||||
{
|
||||
_eventAggregator.PublishEvent(new DownloadFailedEvent
|
||||
{
|
||||
Series = historyItem.Series,
|
||||
Episode = historyItem.Episode,
|
||||
Quality = historyItem.Quality,
|
||||
SourceTitle = historyItem.SourceTitle,
|
||||
DownloadClient = historyItem.Data[DOWNLOAD_CLIENT],
|
||||
DownloadClientId = historyItem.Data[DOWNLOAD_CLIENT_ID]
|
||||
});
|
||||
}
|
||||
SeriesId = historyItem.SeriesId,
|
||||
EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(),
|
||||
Quality = historyItem.Quality,
|
||||
SourceTitle = historyItem.SourceTitle,
|
||||
DownloadClient = historyItem.Data[DOWNLOAD_CLIENT],
|
||||
DownloadClientId = historyItem.Data[DOWNLOAD_CLIENT_ID]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue