Hi,
I try to get upcoming movie and sort it by release date. Here is my query:
https://api.themoviedb.org/3/discover/movie?api_key=XXX&language=fr-FR®ion=FR&sort_by=release_date.asc&include_adult=false&include_video=false&page=1&release_date.gte=2017-10-03
and the result :
{
"page": 1,
"total_results": 342,
"total_pages": 18,
"results": [
{
"vote_count": 115,
"id": 335051,
"video": false,
"vote_average": 6.5,
"title": "Tout mais pas ça !",
"popularity": 5.769984,
"poster_path": "/p6IJqerl8aa1gEeCJpsiMhhtBvY.jpg",
"original_language": "it",
"original_title": "Se Dio vuole",
"genre_ids": [
35
],
"backdrop_path": "/82XJqdrv2VSXfdzGnQ5mYvSEiof.jpg",
"adult": false,
"overview": "Tommaso, la cinquantaine, est un chirurgien affirmé. Avec son épouse Carla, ils ont élevé leur fille Bianca et leur fils Andrea dans un esprit de laïcité. Or voilà qu’Andrea annonce son intention de devenir prêtre. C’en est trop ! Tommaso décide de le suivre en cachette afin d’en savoir plus sur ce prêtre particulier qui a retourné Andrea, bien décidé à le « libérer » de son influence.",
"release_date": "2017-11-29"
},
{
"vote_count": 81,
"id": 334298,
"video": false,
"vote_average": 5.6,
"title": "Chasseur de monstres",
"popularity": 9.033348,
"poster_path": "/v6fLYRKyp8YtkdtdGpPotUuE6CT.jpg",
"original_language": "zh",
"original_title": "捉妖记",
"genre_ids": [
28,
35,
14
],
"backdrop_path": "/4eXO4xhmDxdESdczSS1sfR2ay98.jpg",
"adult": false,
"overview": "Dans un passé lointain, monstres et hommes vivaient en paix, jusqu'au jour ou ces derniers chassèrent les monstres de leur terre. Profitant de la guerre civile engendrée, un ministre usurpe le trône du roi des monstres et veut se débarrasser de la reine et de son futur bébé. Les deux fugitifs bientôt pris au piège, n'ont d'autre choix que de se réfugier chez les hommes....",
"release_date": "2017-11-21"
},
{
"vote_count": 23,
"id": 347752,
"video": false,
"vote_average": 5.9,
"title": "Road Games",
"popularity": 2.939754,
"poster_path": "/wbxXcMeVRtQOJAD1fPeCzC8PoEb.jpg",
"original_language": "en",
"original_title": "Road Games",
"genre_ids": [
53
],
"backdrop_path": "/5KtcFzWJg5MrFAQXM3cdt1d5PhU.jpg",
"adult": false,
"overview": "Un anglais et une française font du stop sur les routes de Normandie alors que la rumeur d'un tueur en série sévissant sur les routes se répand. Un homme les accueille alors chez lui avec sa femme. Mais une étrange impression pousse les deux jeunes gens à se méfier d'eux...",
"release_date": "2017-10-25"
},
{
"vote_count": 11,
"id": 348315,
"video": false,
"vote_average": 5.2,
"title": "Clean Hands",
"popularity": 2.061026,
"poster_path": "/4pnJzXf4wUQvwyWOYVvdAgYr7K7.jpg",
"original_language": "nl",
"original_title": "Schone handen",
"genre_ids": [
80,
18,
53
],
"backdrop_path": "/8p2VGTmBHKXjOZQJ9D1fT5Jr6qr.jpg",
"adult": false,
"overview": "Sylvia et Eddie forment un couple aisé avec deux enfants et mènent la belle vie dans un vieux quartier d'Amsterdam grâce au commerce de drogue dirigé par Eddie. Mais lorsqu'une descente de police vient bouleverser l'ordre des choses, Sylvia tente de protéger ses enfants et décide de fuir l'environnement du crime. Eddie ne l'accepte pas. Si Sylvie en sait trop sur ses activités criminelles, il tient également à conserver sa vie de famille...",
"release_date": "2017-12-27"
},
{...
As you can see the sort is strange. Did i make something wrong ?
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on October 3, 2017 at 7:06 PM
Hi @Zemoa,
Sorting by
release_date.asc
sorts by the earliest release date found on the record, which can vary a lot and isn't going to be what you see returned in therelease_date
field . There isn't really a way to reconcile this difference right now though, ie. sorting by the regional release dates instead.I've created a new ticket to look at this here but I won't have time to look at this one for a while.
Cheers.
Reply by Zemoa
on October 4, 2017 at 1:32 AM
Ok, I understand. Thank you for your answer. Finally I searched week by week and I sorted the result myself on client side.
Bye
Reply by Travis Bell
on October 4, 2017 at 10:20 AM
Yes, that would be your best thing to do for now.
Reply by csabig
on July 29, 2018 at 11:10 AM
Hi there, I have the same problem here. Has this issue been fixed, or can you please suggest anything?
Thanks,
Csaba
Reply by Travis Bell
on August 3, 2018 at 11:54 AM
@csabig What's your query?
Some changes have been made around this but no, I would not generally say that the issue described here has been 100% fixed. If you're specifying a single
release_type
then I believe you should see the data in the right order. But if you are looking for more than a single release type it will still have the same behaviour as above, show the earliest even if it's picking a later one.