Axuda de The Movie Database

after search around the forum, I suppose the total results number is set to 20 per page, but in some queries, like discover/movie, it's not always the case, some times, the first page returns only 19 results, sometimes 9 results, but the second page returns always 20 results. I have to force query starting at page 2 to avoid this variation.

is this a bug ? or it's intentional ? can I force the page returns always 20 results ? (in case their are more than 1 page)

thanks a lot

4 respostas (na páxina 1 de 1)

Jump to last post

A few things to mention so I can get a clearer picture here:

  1. Each page is cached and it's possible that new data has been updated since the time of the original cache leading to either wrong counts and/or additional pages
  2. In those cases when you're checking the second page, are there results? Technically you can request any page you want, but that doesn't necessarily mean there will be results

when i check the second page, there are always results, and the results length is 20. but the first page is not. for example:

  http://api.themoviedb.org/3/discover/movie?page=1&with_genres=28

returns only 19 results, but

 http://api.themoviedb.org/3/discover/movie?page=2&with_genres=28

returns 20 results

http://api.themoviedb.org/3/discover/movie?page=1

returns only 9 results, but

http://api.themoviedb.org/3/discover/movie?page=2

returns 20 results.

Ya, this is a combination of a few things that I'm aware. I've created a new ticket to look at this in the future.

Easy fix for you should be to trust the total_pages field, ignore the number of items being returned in results array.

thanks for your quick reply. much appreciate your help ^

Non podes atopar unha película ou serie? Inicia sesión para creala.

Global

s amosar a barra de procura
p abrir menú do perfil
esc pechar e abrir xanela
? abrir xanela de atallos do teclado

En páxinas de medios

b atrás (ou á principal se aplica)
e ir a editar páxina

En páxinas de tempadas de televisión

(flecha dereita) ir á tempada seguinte
(flecha esquerda) ir á tempada anterior

En páxinas de episodios de televisión

(flecha dereita) ir ao episodio seguinte
(flecha esquerda) ir ao episodio anterior

En todas as páxinas de imaxe

a abrir a xanela de engadir imaxe

En todas as páxinas de edición

t abrir selector de traducións
ctrl+ s enviar formulario

Nas páxinas de debate

n crear un novo debate
w amosar o estado do seguimento
p mudar público/privado
c mudar abrir/pechar
a abrir actividade
r responder no debate
l ir á última resposta
ctrl+ enter eviar a túa mensaxe
(flecha dereita) páxina seguinte
(flecha esquerda) ir á páxina anterior

Configuración

Queres valorar ou engadir o elemento a unha listaxe?

Iniciar sesión