I am fetching my one of my lists via fetch API. Choosing to sort by original ascending returns the same order of results as choosing to sort by original descending. I expected the items to be shown in reversed order when choosing descending order.
BTW, when choosing one of the other sorting options, they work as intended. So, there's no other JS logic on my end that should be impacting the order.
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 robbie3999
on July 5, 2023 at 5:44 PM
Hi @djmtype, can you supply the api url you are using (minus the api_key)? From your description it's not clear to me exactly what you are doing.
Reply by djmtype
on July 5, 2023 at 7:54 PM
I'm actually using the TheMovieDB's UI to control this. screenshot
When I open one of my lists, there are options to sort the order. I know this is working with the other sorting options like sorting by title as I've tested it. However it's just not obeying the order with ascending. Meaning, my most recently added movies in the list are showing up last in the list instead of first.
When I choose one of these sorting options, it's typically reflected in the fetch request, so I am not adding it as a parameter.
Reply by robbie3999
on July 6, 2023 at 9:45 AM
Hi @djmtype, I was a little confused originally because it sounded like you were specifying sort order of a list through the api call, which there are no options to do so. I see now what you are doing.
I going to break this into two parts, the website UI and the api.
It appears like the website UI is working correctly. If you consider sorting by "original", I believe that means the date/time the item was added to the list. So sorting by "original descending" should put new items at the start of the list (sort from new date to old date). Sorting by "original ascending" should put new items at the end of the list (sort from old date to new date). Which is what you are reporting as an error?
When I retrieve the list through the api, it seems to -mostly- reflect the sort order specified through the website UI. The one exception I am seeing is that if you change the sort directly from "original descending" to "original ascending", or from "original ascending" to "original descending", it seems to -not- make that change through the api. This is rather odd because it does make the change in the website UI. I don't have an explanation for that, perhaps it is a bug or maybe I am doing something wrong in testing it.
Perhaps someone else will come along that can confirm or deny this or explain what is happening.
A workaround for the api issue is to just add another sort order when making those particular changes. For example "original descending" to "title" to "original ascending" works.
Reply by djmtype
on July 6, 2023 at 10:09 AM
Unfortunately, I tried that before posting this issue, and that did not work for me. I did exactly that. I selected order by title, save. Then I chose descending order, and save. But, it still showed the list in ascending order as illustrated in my screencast https://cloudup.com/i28-6fx7ep2
Reply by robbie3999
on July 6, 2023 at 10:58 AM
Ok, I tried exactly what you tried, and I get exactly the same results. So the workaround isn't valid.
I do see that "original descending" to "{anything}" to "original ascending" does work. But the reverse does -not-. It doesn't appear like there is -any- way to get a sort order of "original descending" through the api, it always appears as "original ascending". I'm thinking this is probably a bug, but the site admin will have to look at it.