Soporte 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 respuestas (en la página 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 ^

¿No encuentras una película o serie? Inicia sesión para crearla:

Global

s centrar la barra de búsqueda
p abrir menú de perfil
esc cierra una ventana abierta
? abrir la ventana de atajos del teclado

En las páginas multimedia

b retrocede (o a padre cuando sea aplicable)
e ir a la página de edición

En las páginas de temporada de televisión

(flecha derecha) ir a la temporada siguiente
(flecha izquierda) ir a la temporada anterior

En las páginas de episodio de televisión

(flecha derecha) ir al episodio siguiente
(flecha izquierda) ir al episodio anterior

En todas las páginas de imágenes

a abrir la ventana de añadir imagen

En todas las páginas de edición

t abrir la sección de traducción
ctrl+ s enviar formulario

En las páginas de discusión

n crear nueva discusión
w cambiar el estado de visualización
p cambiar público/privado
c cambiar cerrar/abrir
a abrir actividad
r responder a la discusión
l ir a la última respuesta
ctrl+ enter enviar tu mensaje
(flecha derecha) página siguiente
(flecha izquierda) página anterior

Configuraciones

¿Quieres puntuar o añadir este elemento a una lista?

Iniciar sesión