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);
}

@ -38,8 +38,12 @@ namespace Ombi.Api
var httpResponseMessage = await _client.SendAsync(httpRequestMessage);
if (!httpResponseMessage.IsSuccessStatusCode)
{
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
if (request.Retry)
{
@ -93,9 +97,12 @@ namespace Ombi.Api
var httpResponseMessage = await _client.SendAsync(httpRequestMessage);
if (!httpResponseMessage.IsSuccessStatusCode)
{
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
}
// do something with the response
var data = httpResponseMessage.Content;
@ -111,11 +118,14 @@ namespace Ombi.Api
AddHeadersBody(request, httpRequestMessage);
var httpResponseMessage = await _client.SendAsync(httpRequestMessage);
if (!httpResponseMessage.IsSuccessStatusCode)
{
if (!request.IgnoreErrors)
{
LogError(request, httpResponseMessage);
}
}
}
}
private static void AddHeadersBody(Request request, HttpRequestMessage httpRequestMessage)
{

@ -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