mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
Work around the sonarr bug #254
This commit is contained in:
parent
5411225fa0
commit
5024178724
3 changed files with 25 additions and 1 deletions
|
@ -300,5 +300,26 @@ namespace PlexRequests.Api
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Series UpdateSeries(Series series, string apiKey, Uri baseUrl)
|
||||
{
|
||||
var request = new RestRequest { Resource = "/api/Series", Method = Method.PUT };
|
||||
request.AddHeader("X-Api-Key", apiKey);
|
||||
|
||||
request.AddJsonBody(series);
|
||||
|
||||
try
|
||||
{
|
||||
var policy = RetryHandler.RetryAndWaitPolicy((exception, timespan) =>
|
||||
Log.Error(exception, "Exception when calling UpdateSeries for Sonarr, Retrying {0}", timespan));
|
||||
|
||||
return policy.Execute(() => Api.ExecuteJson<Series>(request, baseUrl));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e, "There has been an API exception when put the Sonarr UpdateSeries");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue