Patch/onedr0p 3 13 17 (#1166)

* Update message when the person has no movies with helpful links

* Added ImdbId to the release info from AwesomeHD

* Add ImdbId to release info for PTP and HDBits

* ImdbId is required for HDBits

* Added some error handling in SkyHook for TMDb

* Remove un-needed imports

* DIsable movie search after list sync (causing issues)

* small change

* Fix HDBits tests
This commit is contained in:
Devin Buhl
2017-03-13 22:34:25 -04:00
committed by GitHub
parent 8ece7e8b4d
commit 35e046bb87
11 changed files with 168 additions and 141 deletions
@@ -84,9 +84,18 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
.Build();
request.AllowAutoRedirect = true;
request.SuppressHttpError = true;
// request.SuppressHttpError = true;
var response = _httpClient.Get<MovieResourceRoot>(request);
if (response.StatusCode != HttpStatusCode.OK)
{
throw new HttpException(request, response);
}
if (response.Headers.ContentType != HttpAccept.JsonCharset.Value)
{
throw new HttpException(request, response);
}
// The dude abides, so should us, Lets be nice to TMDb
// var allowed = int.Parse(response.Headers.GetValues("X-RateLimit-Limit").First()); // get allowed
@@ -301,19 +310,28 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
return movie;
}
public Movie GetMovieInfo(string ImdbId)
public Movie GetMovieInfo(string imdbId)
{
var request = _movieBuilder.Create()
.SetSegment("route", "find")
.SetSegment("id", ImdbId)
.SetSegment("id", imdbId)
.SetSegment("secondaryRoute", "")
.AddQueryParam("external_source", "imdb_id")
.Build();
request.AllowAutoRedirect = true;
request.SuppressHttpError = true;
// request.SuppressHttpError = true;
var response = _httpClient.Get<FindRoot>(request);
if (response.StatusCode != HttpStatusCode.OK)
{
throw new HttpException(request, response);
}
if (response.Headers.ContentType != HttpAccept.JsonCharset.Value)
{
throw new HttpException(request, response);
}
// The dude abides, so should us, Lets be nice to TMDb
// var allowed = int.Parse(response.Headers.GetValues("X-RateLimit-Limit").First()); // get allowed