2015-07-29, 10:52
No probs, it was a quick fix and I have had a bit more time to look at it. As the script provides the movieid, I think it would be better to use 'VideoLibrary.GetMovieDetails'.
The way it is now it would get confused if two movies were named the same, so I made some adjustments.
code..
here is the adjusted default.py
default_update.zip
The way it is now it would get confused if two movies were named the same, so I made some adjustments.
code..
PHP Code:
elif actionstring == "sorttitle" :
json_request = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "VideoLibrary.GetMovieDetails", "params": {"properties": ["sorttitle"], "movieid": %s }}' % self.DBID)
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('moviedetails'):
sort_title = str(json_response['result']['moviedetails']['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 adjusted default.py
default_update.zip