2019-09-14, 20:47
Tried to do with this variant:
But is there really no simpler way?
pyrhon:
def getPath(li):
def getFilePath(method, name, id):
params = {'properties': ['file']}
data = {'jsonrpc': '2.0', 'params': params, 'id': '1'}
data['method'] = method
params[name + 'id'] = id
deserialization = json.loads(xbmc.executeJSONRPC(json.dumps(data)))
return deserialization['result'][name + 'details']['file']
content = xbmc.getInfoLabel('Container.Content')
if content == "movies":
path = getFilePath('VideoLibrary.GetMovieDetails', 'movie', li.getVideoInfoTag().getDbId())
elif content == "episodes":
path = getFilePath('VideoLibrary.GetEpisodeDetails', 'episode', li.getVideoInfoTag().getDbId())
elif content == "songs":
path = getFilePath('AudioLibrary.GetSongDetails', 'song', li.getMusicInfoTag().getDbId())
else:
path = li.getPath().decode('UTF-8')
return path
But is there really no simpler way?