Plugin.video.themoviedb.helper: Watchlist sorting issues

Created on 1 Mar 2020  路  15Comments  路  Source: jurialmunkey/plugin.video.themoviedb.helper

Movie watchlist sorting works for me perfect in list or widget, if I only display 10 items. When I toggle "Expand Trakt list limit to 20 items" things change. To illustrate I'm using TmdbHelper/Trakt/Movies Watchlist here.

When only displaying 10 results, sorted by default in TmdbHelper, the resulting list is okay :
(results 1 to 10).

When enabling the toggle in settings to display 20 resuts, I get in this order :
(results 11 to 18) then (results 1-10) then (results 19 and 20).

The result of using the toggle isn't always the same. But the first item in the TmdbHelper-list always gets replaced (by 11 ?).

Tv watchlist sorting is also affected by this, but there are other issues for which I opened another Issue.

(To be complete, in all of the above my Trakt Watchlist on the Trakt website is sorted by "Recently added" before I do stuff in TmdbHelper (if that matters). And to get an easier overview I filter by "Movies" or "Shows". )

(Also, if a movie or episode is both in "Watchlist" AND "Collected" in Trakt, it will (I think) get displayed at the top of the TmdbHelper list.)

Most helpful comment

Okay, I'll add a fix when I'm back home. I'll keep you posted

All 15 comments

(Movie Watchlist order is correct btw)

I'm using TV Shows Watchlist in list or widget, default sort order, 10 results.

I was removing and adding new and allready present shows a couple of times. When compared to the Trakt-website the order in TmdbHelper is :
2 4 5 6 8 9 10 1 3 7

The out of order placement isn't always consistent. The first Trakt show is never displayed first in TmdbHelper though. Mostly in 7th or 8th position.

To be complete, in all of the above my Trakt Watchlist on the Trakt website is sorted by "Recently added". And to get an easier overview I use filter "Movies" or "Shows".

(Also, if a movie or episode is both in "Watchlist" AND "Collected" in Trakt, it will (I think) get displayed at the top of the TmdbHelper list.)

Just moving all to one thread seeings as these both relate to sorting of watchlist

Ok茅 馃檪

Are all the shows/movies at the front in your Kodi Library whereas all the shows later are not?

TMDbHelper always puts items with a DBID first but maybe this needs to be disabled for watchlists as it isn't expected behaviour. I'm not sure if that's whats happening here?

Yes, that's exactly the problem. In my list of 10 those in my library AND in the Trakt watchlist get displayed ahead of those only in my watchlist.

This will probably also solve the "20 toggle" because with 10 extra items to sort there is a high probability some of those get put ahead, what I saw with my movie watchlist with 20 items. Saying that, it must have been total co茂ncidence that my movies-list with 10 items wasn't affected.

Okay, I'll add a fix when I'm back home. I'll keep you posted

I just notice the sorting in TV Shows / Next Aired Library / Last Forthnight and Last Week makes a jump back halfway down the list...

Feb 24. 25, 26 to Feb 29, then Feb 25, 26, 27 to Mar 1

So it's chronological, and then it jumps some days back and is again chronological. I don't see any difference, they are all part of the library.

Also, I'd like to see Last Fornight and Last Week in reverse order (start with Mar 1 then Feb 29, 28, 27), but the sort-button in the list doesn't do anything. And setting "Last Added" and "Descending" in a widget gives a strange result. It gets mixed up even more.

I know this isn't watchlist, so it's more complicated/difficult.

Yeah, sounds like sorting in general is pretty finicky from Trakt (only offered on certain endpoints, only certain sorts allowed, etc...), unless you grab an entire list and sort it "manually" in code, which would likely be a not-insignificant performance hit.

@DaisyF8 - I think this commit should fix the sorting issues: https://github.com/jurialmunkey/plugin.video.themoviedb.helper/commit/6e56656b5d5267ac0c1679372f5d495ae68652f2

Can you test the latest version and confirm that the items are in the correct sort order now?

For the Last Fortnight / Week widgets to be sorted how you want, you need sortby=year sortorder=descending
That's what I use in my main setup. The kodi sort method "dateadded" actually refers to the date the item was added to the kodi library - so that's why you're getting weird results. Perhaps even more confusingly, Kodi's "year" sort method actually sorts by the full premiere date, not just the year.

Sort order in Watchlist for TV and Movies is correct now, with or without toggle 20-items. Works perfect :)

And widget sorting for Last Week and Fortnight using Year/Desc works as expected :p Thx for the tip. So this means that I can't make a shortcut that uses Year/Desc (since the ui doesn't give me Year to sort with) unless I edit the shortcut manually ?

Strange, I don't get the Select Player dialog anymore when selecting an item in Last Week. And it even happens when I use Search or go in my Collections.

https://paste.ubuntu.com/p/7fh7WnKpRS/

And now I first get a Playlist Error, but the Select Player window opens overtop it. I choose Seren, but nothing happens.

https://paste.ubuntu.com/p/KRkWqxQGgC/

I'll try to test more a bit later. This probably isn't related

Strange, I don't get the Select Player dialog anymore when selecting an item in Last Week. And it even happens when I use Search or go in my Collections.

https://paste.ubuntu.com/p/7fh7WnKpRS/

And now I first get a Playlist Error, but the Select Player window opens overtop it. I choose Seren, but nothing happens.

https://paste.ubuntu.com/p/KRkWqxQGgC/

I'll try to test more a bit later. This probably isn't related

These aren't bugs with TMDbHelper - that's an issue with those plugins throwing an exception when being called.

Yeah sorry, I couldn't look into it in detail, but posted the logs just in case.

So the sorting is fixed , thank you for that.

Actually I think there does appear to be something weird going on with the tmdb_id in the library calendar but I don't think this change is what caused it.

Let me know if you want me to test. Afternoon just started where I am.

For Library Next Aired the TMDb ID for the Episode was being set as the TvShow ID. Latest update should fix that. Not sure if that was what was triggering the errors before for you.

This bug was only related to Library Next Aired though - not collections / search.

Was this page helpful?
0 / 5 - 0 ratings