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
Non podes atopar unha película ou serie? Inicia sesión para creala.
Queres valorar ou engadir o elemento a unha listaxe?
Non es membro?
Resposta de Travis Bell
no 12 de xaneiro do 2016 ás 4:47PM
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.Resposta de sparrigan
no 13 de xaneiro do 2016 ás 3:23AM
Good to know, thanks for clarifying!