Stop spamming errors when FanArt doesn't have the image

pull/2478/head
Jamie Rees 7 years ago
parent 95f6426f53
commit bf17bd4754

@ -21,6 +21,7 @@ namespace Ombi.Api.FanartTv
{
var request = new Request($"tv/{tvdbId}", Endpoint, HttpMethod.Get);
request.AddHeader("api-key", token);
request.IgnoreErrors = true;
try
{
return await Api.Request<TvResult>(request);
@ -36,6 +37,7 @@ namespace Ombi.Api.FanartTv
{
var request = new Request($"movies/{movieOrImdbId}", Endpoint, HttpMethod.Get);
request.AddHeader("api-key", token);
request.IgnoreErrors = true;
return await Api.Request<MovieResult>(request);
}

@ -39,7 +39,11 @@ namespace Ombi.Api
if (!httpResponseMessage.IsSuccessStatusCode)
{
LogError(request, httpResponseMessage);
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
if (request.Retry)
{
@ -94,7 +98,10 @@ namespace Ombi.Api
var httpResponseMessage = await _client.SendAsync(httpRequestMessage);
if (!httpResponseMessage.IsSuccessStatusCode)
{
LogError(request, httpResponseMessage);
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
}
// do something with the response
var data = httpResponseMessage.Content;
@ -112,7 +119,10 @@ namespace Ombi.Api
var httpResponseMessage = await _client.SendAsync(httpRequestMessage);
if (!httpResponseMessage.IsSuccessStatusCode)
{
LogError(request, httpResponseMessage);
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
}
}
}

@ -25,7 +25,7 @@ namespace Ombi.Api
public string Endpoint { get; }
public string BaseUrl { get; }
public HttpMethod HttpMethod { get; }
public bool IgnoreErrors { get; set; }
public bool Retry { get; set; }
public List<HttpStatusCode> StatusCodeToRetry { get; set; } = new List<HttpStatusCode>();

@ -13,7 +13,6 @@ namespace Ombi.Notifications
{
public class NotificationMessageCurlys
{
public void Setup(NotificationOptions opts, FullBaseRequest req, CustomizationSettings s)
{
LoadIssues(opts);

Loading…
Cancel
Save