Поддръжка на The Movie Database

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 отговора (на страница 1 от общо 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!

Не можете да откриете филм или сериал? Влезте, за да го създадете.

Глобални

s фокусиране на лентата за търсене
p отваряне на меню "Профил"
esc затваряне на отворен прозорец
? отваряне на прозореца за клавишните комбинации

На страниците за медиите

b връщане назад
e към страницата за редактиране

На страниците за сезони

(стрелка надясно) към следващ сезон
(стрелка наляво) към предишния сезон

На страниците за епизоди

(стрелка надясно) към следващ епизод
(стрелка наляво) предишен епизод

На всички страници за изображения

a отваряне на прозорец за добавяне на изображение

На всички страници за редактиране

t меню за избор на език, на превода
ctrl+ s изпращане на форма

На страниците за дискусия

n създаване на нова дискусия
w статус на наблюдаване
p публична/лична
c затваряне/отваряне
a отваряне на действия
r отговаряне в дискусия
l към последния отговор
ctrl+ enter изпращане на вашето съобщение
(стрелка надясно) следваща страница
(стрелка наляво) предишна страница

Настройки

Искате ли да го оцените или добавите към списък?

Вход