Hi,
I've been having trouble reproducibly paginating results with /discover/ when sorting results. I'm not sure whether this is or a bug, or I'm doing something wrong. Any advice either way would be very gratefully received.
Here's the problem: if - for example - I want to get a list of all movies associated with Humphrey Bogart (actor id: 4110) via discover, then there should be 5 pages of results with a total of 83 distinct entries (according to the total_results and total_pages fields). If I collect the results from all pages with an iteration that queries the following urls (sorting by revenue descending)...
http://api.themoviedb.org/3/discover/movie?with_cast=4110&sort_by=revenue.desc&page=1&api_key=API_KEY http://api.themoviedb.org/3/discover/movie?with_cast=4110&sort_by=revenue.desc&page=2&api_key=API_KEY http://api.themoviedb.org/3/discover/movie?with_cast=4110&sort_by=revenue.desc&page=3&api_key=API_KEY http://api.themoviedb.org/3/discover/movie?with_cast=4110&sort_by=revenue.desc&page=4&api_key=API_KEY http://api.themoviedb.org/3/discover/movie?with_cast=4110&sort_by=revenue.desc&page=5&api_key=API_KEY
...then I end up with less than 83 distinct results (although there are 83 total results, just some of them are being repeated). I found this to be because how results are spread across the pages changes - so that if I were to repeatedly query just page 2 for example, then I wouldn't always get the same entries on that page.
At the moment I'm working around this by just calling the above URLS without 'sort_by=revenue.desc', which seems to fix things. It's no biggie of course, and I can easily sort things on my side. Just thought I'd point it out in case it's either a bug, or I have a misunderstanding that might still be tripping me up without me knowing it. Apologies if this has been brought up before, couldn't find anything on it.
Yours,
Nic
¿No encuentras una película o serie? Inicia sesión para crearla:
¿Quieres puntuar o añadir este elemento a una lista?
¿No eres miembro?
Contestado por Travis Bell
el 12 de enero de 2016 a las 16:47
Hi sparrigan,
Yes, I am aware of some issues when using the default sort. I haven't been able to figure out why this happens sometimes but in the meantime, it's good to know you can get around it with the
revenue.desc
sort.Contestado por sparrigan
el 13 de enero de 2016 a las 03:23
Good to know, thanks for clarifying!