2012-03-09, 02:06
I wanted to post an update on my efforts to add sorting based on filenames. I was able to get it working, though there may be issues with this implementation. Basically, all I had to do was add with the other sort methods, and then I modified the url of xbmcplugin.addDirectoryItem(...) in _add_rom(...) to be set to the cmd argument instead of the format string that was previously there. At least in the current code, the cmd argument to _add_rom(...) is always the path to the rom, so sorting by File results in sorting by the filename. I'm a bit unsure of this implementation though, because I don't know why url was previously set to the format string. It's very much possible that the naming convention used comes in use somewhere else in the plugin or with skin integration. Angelscry, I'm sure you can tell me if I'm breaking anything with this implementation
Edit: It looks like doing this may disable launching anything lol... I'll keep digging through the code to see if I can get this working.
Code:
xbmcplugin.addSortMethod(handle=int( self._handle ), sortMethod=xbmcplugin.SORT_METHOD_FILE)
Edit: It looks like doing this may disable launching anything lol... I'll keep digging through the code to see if I can get this working.