|
|
@ -118,12 +118,14 @@ namespace NzbDrone.Core.History
|
|
|
|
|
|
|
|
|
|
|
|
public void Handle(IndexerQueryEvent message)
|
|
|
|
public void Handle(IndexerQueryEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var response = message.QueryResult.Response;
|
|
|
|
|
|
|
|
|
|
|
|
var history = new History
|
|
|
|
var history = new History
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Date = DateTime.UtcNow,
|
|
|
|
Date = DateTime.UtcNow,
|
|
|
|
IndexerId = message.IndexerId,
|
|
|
|
IndexerId = message.IndexerId,
|
|
|
|
EventType = message.Query.IsRssSearch ? HistoryEventType.IndexerRss : HistoryEventType.IndexerQuery,
|
|
|
|
EventType = message.Query.IsRssSearch ? HistoryEventType.IndexerRss : HistoryEventType.IndexerQuery,
|
|
|
|
Successful = message.QueryResult.Response?.StatusCode == HttpStatusCode.OK
|
|
|
|
Successful = response?.StatusCode == HttpStatusCode.OK || (response is { Request: { SuppressHttpError: true, SuppressHttpErrorStatusCodes: not null } } && response.Request.SuppressHttpErrorStatusCodes.Contains(response.StatusCode))
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (message.Query is MovieSearchCriteria)
|
|
|
|
if (message.Query is MovieSearchCriteria)
|
|
|
|