[RELEASE] Library Editor script
#48
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. Wink

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
Reply


Messages In This Thread
[RELEASE] Library Editor script - by phil65 - 2013-03-09, 20:52
RE: [RELEASE] Library Editor script - by crni - 2013-03-11, 21:20
RE: [RELEASE] Library Editor script - by Gade - 2013-03-14, 00:55
RE: [RELEASE] Library Editor script - by User 55003 - 2015-07-27, 09:02
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Library Editor script3