Update BeyondHD.cs

pull/40/head
Qstick 3 years ago committed by GitHub
parent 5c5dfed000
commit 2f6d9b938c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -106,7 +106,7 @@ namespace NzbDrone.Core.Indexers.Definitions
body.Add("categories", string.Join(",", cats));
}
var searchUrl = BaseUrl + "/api/torrents/" + Settings.ApiKey;
var searchUrl = BaseUrl + "api/torrents/" + Settings.ApiKey;
var request = new HttpRequest(searchUrl, HttpAccept.Json);
@ -190,11 +190,11 @@ namespace NzbDrone.Core.Indexers.Definitions
throw new IndexerException(indexerResponse, $"Unexpected response status {indexerResponse.HttpResponse.StatusCode} code from API request");
}
if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value))
{
throw new IndexerException(indexerResponse, $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from API request, expected {HttpAccept.Json.Value}");
}
// TODO Have BHD fix their API response content type so we can proper check here
// if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value))
// {
// throw new IndexerException(indexerResponse, $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from API request, expected {HttpAccept.Json.Value}");
// }
var jsonResponse = new HttpResponse<BeyondHDResponse>(indexerResponse.HttpResponse);
foreach (var row in jsonResponse.Resource.Results)

Loading…
Cancel
Save