mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Fixed #515
This commit is contained in:
parent
e563b5bf3d
commit
24b1d82084
4 changed files with 57 additions and 1 deletions
|
@ -273,6 +273,25 @@ namespace PlexRequests.Api
|
|||
}
|
||||
}
|
||||
|
||||
public SonarrEpisodes UpdateEpisode(SonarrEpisodes episodeInfo, string apiKey, Uri baseUrl)
|
||||
{
|
||||
var request = new RestRequest { Resource = "/api/Episode", Method = Method.PUT };
|
||||
request.AddHeader("X-Api-Key", apiKey);
|
||||
request.AddJsonBody(episodeInfo);
|
||||
try
|
||||
{
|
||||
var policy = RetryHandler.RetryAndWaitPolicy((exception, timespan) =>
|
||||
Log.Error(exception, "Exception when calling UpdateEpisode for Sonarr, Retrying {0}", timespan));
|
||||
|
||||
return policy.Execute(() => Api.ExecuteJson<SonarrEpisodes>(request, baseUrl));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(e, "There has been an API exception when put the Sonarr UpdateEpisode");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search for one or more episodes
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue