The Movie Database Support

Hi! After last update, I realise that my results using the "discovery" method got weird results Take a look:

http://api.themoviedb.org/3/discover/movie?api_key=XXXXX&vote_count.gte=10&sort_by=release_date.desc

{"adult":false,"backdrop_path":"/vkSD3JjyW7XKuK4z88mhPgqD2k1.jpg","id":229407,"original_title":"Puppy","release_date":"2013-12-10","poster_path":"/maBSw4YgUzjQoowiMI51FG0Npzc.jpg","popularity":0.36656922222498,"title":"Puppy","vote_average":8.4,"vote_count":24},

{"adult":false,"backdrop_path":"/uNa5sbuoVvXFIdVo0De2HJrrxOd.jpg","id":227156,"original_title":"The Giver","release_date":"2014-08-15","poster_path":"/pBId6jhii1vP2CShtrGLB3SuKhc.jpg","popularity":9.03227783839263,"title":"The Giver","vote_average":6.8,"vote_count":78}, ...

It is sorting the date release in a random way... Am I doing something wrong?

21 replies (on page 1 of 2)

Jump to last post

Next pageLast page

Hi iblop,

I can see this happening as well. I'm not 100% sure yet, but will look into it. Thanks for the report.

yeah this broken our entire genres view

Here is one example query we make https://api.themoviedb.org/3/discover/movie?api_key=&with_genres=28&language=en&page=1&vote_count.gte=5&sort_by=release_date.desc

The fix for this has been pushed live, it will take a few hours for any cached requests to expire (so you won't necessarily see any difference right away).

P.S. /discover/movie got a decent little upgrade today, I'd suggest taking a look over at the docs for more info. One in particular is a new sort option for primary_release_date which I know a lot of people wanted.

@hosam in reply to this tweet: http://twitter.com/TodoMoviesApp/status/522757720844554240

I am seeing different pages with these queries:

http://api.themoviedb.org/3/discover/movie?api_key=###&vote_count.gte=5&sort_by=release_date.desc&with_genres=18&page=1
http://api.themoviedb.org/3/discover/movie?api_key=###&vote_count.gte=5&sort_by=release_date.desc&with_genres=18&page=2
http://api.themoviedb.org/3/discover/movie?api_key=###&vote_count.gte=5&sort_by=release_date.desc&with_genres=18&page=3

As I mentioned, you'll have to wait for cached items to expire, it's possible you're still running into some cached results.

Thx for the reply and the fix! I will check as soon as possible :)

I can't decided if I'm hijacking this thread or not, but it seems related, so I'm going to take a chance and post it here: Was the sort by title not working recently too, or possibly just an issue with the API docs? I updated an app from the old API version to v3 a few weeks ago (roughly) and I swear the documentation did not list title as a possible sort option. It seems to be working now (though some of the results seem odd to me, which I will inspect further and possibly post a new thread).

Hey Matt,

That would be because it just got added 2 days ago ;) You can read the announcement post here.

With regards to sorting by original_title, keep in mind that, that is exactly what it is. The results are not sorted by the translated title. We are stripping “the” out of the beginning of strings but I believe that’s about it.

https://api.themoviedb.org/3/discover/movie?api_key=###&sort_by=original_title.asc&vote_count.gte=30&with_genres=35

Looks pretty good to me...

Oh, well good timing then since I am hoping to publish the updated app in the next few days. I saw that announcement but didn't notice the date, and I couldn't tell from what I read which ones were new. Thanks for the info. I'll double-check what I'm seeing in my app and make sure I'm not seeing a bug. Should I be preferring original_title over title?

Hey Travis,

It is still broken

The query you pasted above http://api.themoviedb.org/3/discover/movie api_key=##&vote_count.gte=5&sort_by=release_date.dsc&with_genres=18&page=1

Expected Result: Return movies sorted by the release date New to Old.

Actual Results: Randomly sorted movies. First result is Jump In! with release date 2007 and second is Choke with 2008

That problem is in all other categories as well. The results aren't returned sorted by the date.

You’re missing an e in your release_date.desc.

https://api.themoviedb.org/3/discover/movie?api_key=###&vote_count.gte=5&sort_by=release_date.desc&with_genres=18&page=1

Now, Black is being returned first because someone added a 2016 release to it, but I’m pretty sure that is wrong.

Reminder, using the new sort_by=primary_release_date.desc would have fixed this particular issue with Black but will generally provide better (expected results).

okay it seems that this mess happened because now you just pick the latest release date .

Obviously this will generate numerous bugs since many movies release date are off sometimes by more than one year for example https://www.themoviedb.org/movie/152795-the-congress/edit?active_nav_item=release_information

I guess I will have to switch to the primary date sorting but that won't fix it either because many movies don't have the primary date set either which won't help fix the issue.

The way currently sorting workings is incorrect. Sometimes you pick US date, sometimes, UK, IT,..etc there is no consistency like that for the sorting. Maybe make a parameter for the country used for sorting and if it doesn't exist then fall back to the primary release. Otherwise the current results returned are irrelevant to everyone around the world.

I was just going to say, I tried primary_release_date and it seemed to fix the incorrect sorting. The following query always returns a movie with a release_date in 2006 as the first entry in this category:

http://api.themoviedb.org/3/discover/movie?api_key=XXX&language=en&sort_by=release_date.desc&with_genres=28&release_date.lte=2014-10-19

Changing the sort to primary_release_date provides more consistent results. It still looks like a bug, since release_date is listed as a valid sort_by option.

The way currently sorting workings is incorrect. Sometimes you pick US date, sometimes, UK, IT,

Ok, I think I get where you’re coming from... this was never something that was consciously accounted for but sorting by release date should probably actually look at, what are we thinking here, the earliest release date of a movie? It’s got to be either earliest or latest. With this decided on, the behaviour can be changed.

The following query always returns a movie with a release date in 2006 as the first entry in this category

If you take a look at the movie, it has a release for 2208 added to it. That’s why it’s first.

With the proposed change, it still wouldn’t change Matt’s query... Basilisk would still be included. But perhaps the order would be different if we look at the earliest release date instead.

Yup. You need to pick the earliest release date for a movie and use that for both sorting Ascending and Descending. That way it will be more consistent and results should be more or less like before. That also will take care of those super weird anomalies that are like 1 year off.

In addition to that fix you can add a new parameter which accepts the country flag for sorting (if not available then fall back to earliest date). Then the users can actually get results relevant to their location.

Currently the API is returning a lot of incorrect sorting order which wasn't the case before. I do understand it wasn't optimal before but it was working to some extend and the users were pretty happy with it.

It's definitely strange looking behavior, and for users that don't understand the why, it just looks wrong. When the search results are sorted by original title, which in many cases is in a foreign character set, so they show first when sorting descending, and the translated title is shown, they just look all out of order. I may just end up not showing anything where the original title does not match the translated title, but I'd prefer to be able to filter directly in the query to only return movies originally released in a particular country. Is that technically feasible? Are there cases where that is a bad user experience?

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?

Login