2016-02-13, 18:29
I try to mod a addon (THHifgLights) cause I would need one more property from the addon.
I wood need the PVR uniqueID... So tried to "copie" existent Property...
but I allway get the an error:
I tried as follow:
so how can I define the name... I did not find it...
I wood need the PVR uniqueID... So tried to "copie" existent Property...
but I allway get the an error:
Quote:Error Contents: global name 'uniqueid' is not defined
I tried as follow:
Code:
def channelName2uniqueId(channelname):
query = {
"jsonrpc": "2.0",
"method": "PVR.GetChannels",
"params": {"channelgroupid": "alltv"},
"id": 1
}
res = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))
#debug(res)
# translate via json if necessary
trans = json.loads(str(ChannelTranslate))
for tr in trans:
if channelname == tr['name']:
debug("Translating %s to %s" % (channelname,tr['pvrname']))
channelname = tr['pvrname']
if 'result' in res and 'channels' in res['result']:
res = res['result'].get('channels')
for channels in res:
#debug("TVHighlights %s - %s" % (channels['label'],channelname))
# priorize HD Channel
if channelname+" HD".lower() in channels['label'].lower():
debug("TVHighlights found HD priorized channel %s" % (channels['label']))
return channels['uniqueid']
if channelname.lower() in channels['label'].lower():
debug("TVHighlights found channel %s" % (channels['label']))
return channels['uniqueid']
return 0
so how can I define the name... I did not find it...