The Movie Database Support

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

2 replies (on page 1 of 1)

Jump to last post

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.

Good to know, thanks for clarifying!

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

লগইন