Fixed: Switch to discover/movie for TMDB Keyword list

pull/10128/head
Bogdan 5 months ago
parent 54965cfa6f
commit 92a19a1a81

@ -24,13 +24,13 @@ namespace NzbDrone.Core.ImportLists.TMDb.Company
private IEnumerable<ImportListRequest> GetMoviesRequest()
{
Logger.Info($"Importing TMDb movies from company: {Settings.CompanyId}");
Logger.Info("Importing TMDb movies from company: {0}", Settings.CompanyId);
var requestBuilder = RequestBuilder.Create()
.SetSegment("api", "3")
.SetSegment("route", "discover")
.SetSegment("id", $"movie")
.SetSegment("secondaryRoute", "");
.SetSegment("api", "3")
.SetSegment("route", "discover")
.SetSegment("id", "movie")
.SetSegment("secondaryRoute", "");
requestBuilder.AddQueryParam("with_companies", Settings.CompanyId);
@ -44,7 +44,7 @@ namespace NzbDrone.Core.ImportLists.TMDb.Company
var request = requestBuilder.Build();
Logger.Debug($"Importing TMDb movies from: {request.Url}");
Logger.Debug("Importing TMDb movies from: {0}", request.Url);
yield return new ImportListRequest(request);
}

@ -24,13 +24,15 @@ namespace NzbDrone.Core.ImportLists.TMDb.Keyword
private IEnumerable<ImportListRequest> GetMoviesRequest()
{
Logger.Info($"Importing TMDb movies from keyword Id: {Settings.KeywordId}");
Logger.Info("Importing TMDb movies from keyword Id: {0}", Settings.KeywordId);
var requestBuilder = RequestBuilder.Create()
.SetSegment("api", "3")
.SetSegment("route", "keyword")
.SetSegment("id", $"{Settings.KeywordId}")
.SetSegment("secondaryRoute", "/movies");
.SetSegment("api", "3")
.SetSegment("route", "discover")
.SetSegment("id", "movie")
.SetSegment("secondaryRoute", "");
requestBuilder.AddQueryParam("with_keywords", Settings.KeywordId);
var jsonResponse = JsonConvert.DeserializeObject<MovieSearchResource>(HttpClient.Execute(requestBuilder.Build()).Content);
@ -42,7 +44,7 @@ namespace NzbDrone.Core.ImportLists.TMDb.Keyword
var request = requestBuilder.Build();
Logger.Debug($"Importing TMDb movies from: {request.Url}");
Logger.Debug("Importing TMDb movies from: {0}", request.Url);
yield return new ImportListRequest(request);
}

@ -24,15 +24,15 @@ namespace NzbDrone.Core.ImportLists.TMDb.List
private IEnumerable<ImportListRequest> GetMoviesRequest()
{
Logger.Info($"Importing TMDb movies from list: {Settings.ListId}");
Logger.Info("Importing TMDb movies from list: {0}", Settings.ListId);
var requestBuilder = RequestBuilder.Create()
.SetSegment("api", "4")
.SetSegment("route", "list")
.SetSegment("id", Settings.ListId)
.SetSegment("secondaryRoute", "");
.SetSegment("api", "4")
.SetSegment("route", "list")
.SetSegment("id", Settings.ListId)
.SetSegment("secondaryRoute", "");
Logger.Debug($"Getting total pages that TMDb List: {Settings.ListId} consists of");
Logger.Debug("Getting total pages that TMDb List: {0} consists of", Settings.ListId);
var jsonResponse = JsonConvert.DeserializeObject<MovieSearchResource>(HttpClient.Execute(requestBuilder.Build()).Content);
@ -44,7 +44,7 @@ namespace NzbDrone.Core.ImportLists.TMDb.List
var request = requestBuilder.Build();
Logger.Debug($"Importing TMDb movies from: {request.Url}");
Logger.Debug("Importing TMDb movies from: {0}", request.Url);
yield return new ImportListRequest(request);
}

@ -22,16 +22,15 @@ namespace NzbDrone.Core.ImportLists.TMDb.Person
private IEnumerable<ImportListRequest> GetMoviesRequest()
{
Logger.Info($"Importing TMDb movies from person: {Settings.PersonId}");
Logger.Info("Importing TMDb movies from person: {0}", Settings.PersonId);
var requestBuilder = RequestBuilder.Create()
.SetSegment("api", "3")
.SetSegment("route", "person")
.SetSegment("id", Settings.PersonId)
.SetSegment("secondaryRoute", "/movie_credits");
.SetSegment("api", "3")
.SetSegment("route", "person")
.SetSegment("id", Settings.PersonId)
.SetSegment("secondaryRoute", "/movie_credits");
yield return new ImportListRequest(requestBuilder.Accept(HttpAccept.Json)
.Build());
yield return new ImportListRequest(requestBuilder.Accept(HttpAccept.Json).Build());
}
}
}

@ -45,10 +45,10 @@ namespace NzbDrone.Core.ImportLists.TMDb.Popular
var threeMonthsFromNow = DateTime.Parse(todaysDate).AddMonths(3).ToString("yyyy-MM-dd");
var requestBuilder = RequestBuilder.Create()
.SetSegment("api", "3")
.SetSegment("route", "discover")
.SetSegment("id", "")
.SetSegment("secondaryRoute", "movie");
.SetSegment("api", "3")
.SetSegment("route", "discover")
.SetSegment("id", "")
.SetSegment("secondaryRoute", "movie");
switch (Settings.TMDbListType)
{
@ -110,11 +110,13 @@ namespace NzbDrone.Core.ImportLists.TMDb.Popular
for (var pageNumber = 1; pageNumber <= MaxPages; pageNumber++)
{
Logger.Info($"Importing TMDb movies from: {requestBuilder.BaseUrl}&page={pageNumber}");
requestBuilder.AddQueryParam("page", pageNumber, true);
yield return new ImportListRequest(requestBuilder.Build());
var request = requestBuilder.Build();
Logger.Debug("Importing TMDb movies from: {0}", request.Url);
yield return new ImportListRequest(request);
}
}
}

@ -27,10 +27,10 @@ namespace NzbDrone.Core.ImportLists.TMDb.User
private IEnumerable<ImportListRequest> GetMoviesRequests()
{
var requestBuilder = RequestBuilder.Create()
.SetHeader("Authorization", $"Bearer {Settings.AccessToken}")
.SetSegment("api", "4")
.SetSegment("route", "account")
.SetSegment("id", Settings.AccountId);
.SetHeader("Authorization", $"Bearer {Settings.AccessToken}")
.SetSegment("api", "4")
.SetSegment("route", "account")
.SetSegment("id", Settings.AccountId);
switch (Settings.ListType)
{
@ -62,7 +62,7 @@ namespace NzbDrone.Core.ImportLists.TMDb.User
var request = requestBuilder.Build();
Logger.Debug($"Importing TMDb movies from: {request.Url}");
Logger.Debug("Importing TMDb movies from: {0}", request.Url);
yield return new ImportListRequest(request);
}

Loading…
Cancel
Save