What is the behaviour of xbmcplugin.addSortMethod ?
#1
Yet another stupid question.

I have the following in an addon:
xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_DATE)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_GENRE)

Using Gotham Alpha6, when I try to change the sort method on the sidebar menu, I can't change it from "Default", the mouse/keyboard won't focus on "Sort by:".
Tried a couple of skins and it behaves the same in all. Went back to 12.2 and seems the same.
If I get rid of the addSortMethod for UNSORTED, all is well and I can change the sort method.

If I move the addSortMethod for UNSORTED from the the first call position, I can change Sort By until I select default (UNSORTED). After that I can't select a different sort method in same way as described above.
Is this the intended behaviour?

Thanks
Reply
#2
Does anyone know the answer to above? I also experience the same issue when SORT_METHOD_NONE is in the list. I'm trying to maintain some older addons which use this. The issue exists in Gotham 13.1 as well.
Reply
#3
Yes, that is by design. SORT_METHOD_NONE or SORT_METHOD_UNSORTED mean you don't have any sort methods. i.e. XBMC won't attempt to change the sort mode if that's what it's currently on.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
(2014-05-17, 04:03)jmarshall Wrote: Yes, that is by design. SORT_METHOD_NONE or SORT_METHOD_UNSORTED mean you don't have any sort methods. i.e. XBMC won't attempt to change the sort mode if that's what it's currently on.

Ok Thanks. I was confused because there are several addons in the xbmc.org repo that add UNSORTED to a list of sort methods (like I show in the first post), so I thought that it would just be displayed in the order in which the items were inserted into the list (I was wondering how you would get back to that order if you specified a sort then went back to unsorted). To be clear: if one uses SORT_METHOD_NONE or SORT_METHOD_UNSORTED it should be the only method in the list?

Lastly, what is the scope of the addSortMethod routine, is it the directory items which are added subsequent to the call, all the directories in the addon, all directories in any addon until the next addSortMethod, or something else?
Thanks.
Reply
#5
It applies to the one list only.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
What is the behaviour of xbmcplugin.addSortMethod ?0