Hey, When I do a http-request to get a list of mine, it keeps on changing order when I refresh. I would like the ordering to be the same as in my account, just sorted by the date I added the titles. Is this possible, or am I doing something wrong? Thanks in advance.
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 ticao2 π§π· pt-BR
on December 6, 2018 at 9:29 AM
It will be much easier to find the solution to your problem if you put here the API Request you are doing.
Remember to replace your Key with the expression [MY_KEY].
Reply by TorgasMick
on December 6, 2018 at 9:53 AM
I was using following request:
Even if you put the request in a webbrowser, you can see the values change if you refresh the page several times. (Edit: Removed my api key)
Reply by ticao2 π§π· pt-BR
on December 6, 2018 at 10:03 AM
I made the conversation Private.
You forgot to replace your Key with the [MY_KEY] expression.
Your API Key should be kept secret. Only for you.
You are using v3 version.
Only v4 allows you to define sorting criteria.
Look here: https://developers.themoviedb.org/3/lists/v4-or-v3-lists
Reply by TorgasMick
on December 6, 2018 at 10:08 AM
Thanks in advance. But in the V4 version, I still see the json data moving around when I refresh. (trying it just in browser) The json data changes almost every refresh, This is what I'm trying to solve. You can test it using my list (it's a short one, so you'll see.)
Reply by ticao2 π§π· pt-BR
on December 6, 2018 at 10:14 AM
Not setting Sort Order the list will come in the order of creation, I think.
The possible parameters are:
release_date.asc
release_date.desc
title.asc (Original Title)
title.desc (Original Title)
vote_average.asc
vote_average.desc
Edit: Place your Request v4 here
Reply by ticao2 π§π· pt-BR
on December 6, 2018 at 10:35 AM
I tested your list with a v4 Requisition without defining Sort Order.
The result is set to "sort_by": "original_order.desc"
What I received is exactly the same as your list on the TMDb Site.
Reply by TorgasMick
on December 7, 2018 at 1:51 AM
Nice! It seems like your solution also works in the V3 version! This sorting method is never mentioned in the possibilities, they should.
Thanks a lot, man!
Edit: Seems like my previous comment was not correct - The sorting is only consistent in v4 - Using v4 now so the problem is still solved, thanks!
Reply by Travis Bell
on December 7, 2018 at 11:23 AM
Good catch @TorgasMick, I've updated the docs.