1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Use Post for tmdbids request, to avoid too long URIs.

This commit is contained in:
Leonardo Galli 2017-04-28 13:14:00 +02:00
parent 446d661345
commit b1025e7229

View File

@ -15,6 +15,7 @@
using System.Threading;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Profiles;
using NzbDrone.Common.Serializer;
namespace NzbDrone.Core.MetadataSource.SkyHook
{
@ -351,11 +352,15 @@ public Movie GetMovieInfo(string imdbId)
public List<Movie> DiscoverNewMovies()
{
string allIds = string.Join(",", _movieService.GetAllMovies().Select(m => m.TmdbId));
var request = new HttpRequestBuilder("https://radarr.video/recommendations/api.php").AddQueryParam("tmdbids", allIds).Build();
var request = new HttpRequestBuilder("https://radarr.video/recommendations/api.php").Build();
request.AllowAutoRedirect = true;
request.Method = HttpMethod.POST;
request.Headers.ContentType = "application/x-www-form-urlencoded";
request.SetContent($"tmdbids={allIds}");
var response = _httpClient.Get<List<MovieResult>>(request);
var response = _httpClient.Post<List<MovieResult>>(request);
if (response.StatusCode != HttpStatusCode.OK)
{
throw new HttpException(request, response);