|
|
|
@ -86,12 +86,15 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
|
// The dude abides, so should us, Lets be nice to TMDb
|
|
|
|
|
// var allowed = int.Parse(response.Headers.GetValues("X-RateLimit-Limit").First()); // get allowed
|
|
|
|
|
// var reset = long.Parse(response.Headers.GetValues("X-RateLimit-Reset").First()); // get time when it resets
|
|
|
|
|
if (response.Headers.ContainsKey("X-RateLimit-Remaining"))
|
|
|
|
|
{
|
|
|
|
|
var remaining = int.Parse(response.Headers.GetValues("X-RateLimit-Remaining").First());
|
|
|
|
|
if (remaining <= 5)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Waiting 5 seconds to get information for the next 35 movies");
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var resource = response.Resource;
|
|
|
|
|
if (resource.status_message != null)
|
|
|
|
@ -333,12 +336,15 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|
|
|
|
// The dude abides, so should us, Lets be nice to TMDb
|
|
|
|
|
// var allowed = int.Parse(response.Headers.GetValues("X-RateLimit-Limit").First()); // get allowed
|
|
|
|
|
// var reset = long.Parse(response.Headers.GetValues("X-RateLimit-Reset").First()); // get time when it resets
|
|
|
|
|
if (response.Headers.ContainsKey("X-RateLimit-Remaining"))
|
|
|
|
|
{
|
|
|
|
|
var remaining = int.Parse(response.Headers.GetValues("X-RateLimit-Remaining").First());
|
|
|
|
|
if (remaining <= 5)
|
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Waiting 5 seconds to get information for the next 35 movies");
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var resources = response.Resource;
|
|
|
|
|
|
|
|
|
|