2015-07-27, 09:02
I had a closer look and got it working. Turned out to be fairly simple.
You could go crazy and turn the added code in a module to service other requests but seeing as I use the builtin kodi edit I think I'll leave it here and let you tinker if you like.
Here is the code I added to get it working.
Here is the default.py file
default.zip
You could go crazy and turn the added code in a module to service other requests but seeing as I use the builtin kodi edit I think I'll leave it here and let you tinker if you like.
Here is the code I added to get it working.
PHP Code:
elif actionstring == "sorttitle" :
json_request = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "filter": {"field": "title", "operator": "is", "value": "'+xbmc.getInfoLabel('ListItem.Title')+'"}, "properties" : ["sorttitle"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": "libMovies"}')
json_request = unicode(json_request, 'utf-8', errors='ignore')
json_response = json.loads(json_request)
if json_response.has_key('result') and (json_response['result'] != None) and json_response['result'].has_key('movies'):
for item in json_response['result']['movies']:
sort_title = item['sorttitle']
if sort_title == "":
self._edit_db_string(xbmc.getInfoLabel('ListItem.Title'),self.TYPE,"sorttitle")
else:
self._edit_db_string(sort_title,self.TYPE,"sorttitle")
Here is the default.py file
default.zip