mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-24 06:27:08 -04:00
Fixed: TMDB Failing due to missing response header (#3610)
This commit is contained in:
parent
c27f08738a
commit
df068e9f0a
1 changed files with 14 additions and 8 deletions
|
@ -86,11 +86,14 @@ 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
|
||||
var remaining = int.Parse(response.Headers.GetValues("X-RateLimit-Remaining").First());
|
||||
if (remaining <= 5)
|
||||
if (response.Headers.ContainsKey("X-RateLimit-Remaining"))
|
||||
{
|
||||
_logger.Trace("Waiting 5 seconds to get information for the next 35 movies");
|
||||
Thread.Sleep(5000);
|
||||
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;
|
||||
|
@ -333,11 +336,14 @@ 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
|
||||
var remaining = int.Parse(response.Headers.GetValues("X-RateLimit-Remaining").First());
|
||||
if (remaining <= 5)
|
||||
if (response.Headers.ContainsKey("X-RateLimit-Remaining"))
|
||||
{
|
||||
_logger.Trace("Waiting 5 seconds to get information for the next 35 movies");
|
||||
Thread.Sleep(5000);
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue