mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Blacklisting will trigger episode search
This commit is contained in:
@@ -20,6 +20,8 @@ namespace NzbDrone.Core.History
|
||||
PagingSpec<History> Paged(PagingSpec<History> pagingSpec);
|
||||
List<History> BetweenDates(DateTime startDate, DateTime endDate, HistoryEventType eventType);
|
||||
List<History> Failed();
|
||||
List<History> Grabbed();
|
||||
History MostRecentForEpisode(int episodeId);
|
||||
}
|
||||
|
||||
public class HistoryService : IHistoryService, IHandle<EpisodeGrabbedEvent>, IHandle<EpisodeImportedEvent>, IHandle<DownloadFailedEvent>
|
||||
@@ -53,6 +55,16 @@ namespace NzbDrone.Core.History
|
||||
return _historyRepository.Failed();
|
||||
}
|
||||
|
||||
public List<History> Grabbed()
|
||||
{
|
||||
return _historyRepository.Grabbed();
|
||||
}
|
||||
|
||||
public History MostRecentForEpisode(int episodeId)
|
||||
{
|
||||
return _historyRepository.MostRecentForEpisode(episodeId);
|
||||
}
|
||||
|
||||
public void Purge()
|
||||
{
|
||||
_historyRepository.Purge();
|
||||
@@ -122,20 +134,23 @@ namespace NzbDrone.Core.History
|
||||
|
||||
public void Handle(DownloadFailedEvent message)
|
||||
{
|
||||
var history = new History
|
||||
foreach (var episodeId in message.EpisodeIds)
|
||||
{
|
||||
EventType = HistoryEventType.DownloadFailed,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.Quality,
|
||||
SourceTitle = message.SourceTitle,
|
||||
SeriesId = message.Series.Id,
|
||||
EpisodeId = message.Episode.Id,
|
||||
};
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.DownloadFailed,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.Quality,
|
||||
SourceTitle = message.SourceTitle,
|
||||
SeriesId = message.SeriesId,
|
||||
EpisodeId = episodeId,
|
||||
};
|
||||
|
||||
history.Data.Add("DownloadClient", message.DownloadClient);
|
||||
history.Data.Add("DownloadClientId", message.DownloadClientId);
|
||||
history.Data.Add("DownloadClient", message.DownloadClient);
|
||||
history.Data.Add("DownloadClientId", message.DownloadClientId);
|
||||
|
||||
_historyRepository.Insert(history);
|
||||
_historyRepository.Insert(history);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user