mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
Merge branch 'dev' of https://github.com/tidusjar/PlexRequests.Net into dev
This commit is contained in:
commit
4cf4b33305
57 changed files with 1415 additions and 388 deletions
|
@ -100,9 +100,9 @@ namespace Ombi.Api
|
|||
|
||||
var obj = RetryHandler.Execute<CouchPotatoStatus>(() => Api.Execute<CouchPotatoStatus>(request, url),
|
||||
(exception, timespan) => Log.Error(exception, "Exception when calling GetStatus for CP, Retrying {0}", timespan), new TimeSpan[] {
|
||||
TimeSpan.FromSeconds (2),
|
||||
TimeSpan.FromSeconds(5),
|
||||
TimeSpan.FromSeconds(10)});
|
||||
TimeSpan.FromSeconds (1),
|
||||
TimeSpan.FromSeconds(2),
|
||||
TimeSpan.FromSeconds(3)});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -140,9 +140,9 @@ namespace Ombi.Api
|
|||
{
|
||||
var obj = RetryHandler.Execute(() => Api.Execute<CouchPotatoMovies>(request, baseUrl),
|
||||
(exception, timespan) => Log.Error(exception, "Exception when calling GetMovies for CP, Retrying {0}", timespan), new[] {
|
||||
TimeSpan.FromSeconds (5),
|
||||
TimeSpan.FromSeconds(10),
|
||||
TimeSpan.FromSeconds(30)
|
||||
TimeSpan.FromSeconds (1),
|
||||
TimeSpan.FromSeconds(5),
|
||||
TimeSpan.FromSeconds(5)
|
||||
});
|
||||
|
||||
return obj;
|
||||
|
|
|
@ -103,6 +103,27 @@ namespace Ombi.Api
|
|||
return GetAll<EmbyEpisodeItem>("Episode", apiKey, userId, baseUri);
|
||||
}
|
||||
|
||||
public EmbyItemContainer<EmbyMovieInformation> GetCollection(string mediaId, string apiKey, string userId, Uri baseUrl)
|
||||
{
|
||||
var request = new RestRequest
|
||||
{
|
||||
Resource = "emby/users/{userId}/items?parentId={mediaId}",
|
||||
Method = Method.GET
|
||||
};
|
||||
|
||||
request.AddUrlSegment("userId", userId);
|
||||
request.AddUrlSegment("mediaId", mediaId);
|
||||
|
||||
AddHeaders(request, apiKey);
|
||||
|
||||
|
||||
var policy = RetryHandler.RetryAndWaitPolicy((exception, timespan) => Log.Error(exception, "Exception when calling GetCollections for Emby, Retrying {0}", timespan), new[] {
|
||||
TimeSpan.FromSeconds (1),
|
||||
TimeSpan.FromSeconds(5)
|
||||
});
|
||||
return policy.Execute(() => Api.ExecuteJson<EmbyItemContainer<EmbyMovieInformation>>(request, baseUrl));
|
||||
}
|
||||
|
||||
public EmbyInformation GetInformation(string mediaId, EmbyMediaType type, string apiKey, string userId, Uri baseUri)
|
||||
{
|
||||
var request = new RestRequest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue