VideoLibrary.GetMovies - How to sort by ID?
#1
I can't seem to sort by ID.
Basically, I just want to reverse the default sort order (which appears to by id).

I have tried using these as methods 'id' 'movieid' 'default' 'none'
but they cause it to break (except none which has no affect).

I want to list movies by the order they added to DB (which is different to dateadded).

Any ideas?
Reply
#2
Looks like might not be possible Sad

https://github.com/xbmc/xbmc/blob/master....json#L103

Code:
"enum": [ "none", "label", "date", "size", "file", "path", "drivetype", "title", "track", "time", "artist",
                  "album", "albumtype", "genre", "country", "year", "rating", "userrating", "votes", "top250", "programcount",
                  "playlist", "episode", "season", "totalepisodes", "watchedepisodes", "tvshowstatus", "tvshowtitle",
                  "sorttitle", "productioncode", "mpaa", "studio", "dateadded", "lastplayed", "playcount", "listeners",
                  "bitrate", "random" ]
},

Is this possibly an oversight?
The default sorting is "none"
The default order is "ascending"

I therefore thought setting the sorting to "none" and order to "descending" would achieve what I want, but it doesn't.
I assume when it sees "none", it's just ignored completely.

Originally I was getting all movies and just using JS to reverse the array.
However, I'm now wanting to do pagination so it needs to be done at DB level.

Thanks,

Matt
Reply
#3
As I am building KODI, I think I will just patch in the SortByID method.
Here's the patch

http://pastebin.com/raw/2Q0dnWgs

Only real thing wrong with the patch is I have used the language ID for SortByNone (16018) for the SortByID method.
Ideally, you want want to add a new language ID for it.
However, for my headless KODI - this won't matter at all.
Reply

Logout Mark Read Team Forum Stats Members Help
VideoLibrary.GetMovies - How to sort by ID?0