2016-09-14, 10:57
Hi at all,
I try check via fsonrpc if a TVShow episode is in db or not...
If I understand right for this I would need the tvshowid by name.
So I tried:
but it allways returning "FALSE" but it's for sure that the tvshow is in the db...
I don't know were I'm wrong...
I try check via fsonrpc if a TVShow episode is in db or not...
If I understand right for this I would need the tvshowid by name.
So I tried:
Code:
def TVShowName2TVShowDBID(tvshowname):
query = {
"jsonrpc": "2.0",
"method": "VideoLibrary.GetTVShows",
"params": {
"properties": ["originaltitle", "tvshowid"]
},
"id": "libTvShows"
}
res = json.loads(xbmc.executeJSONRPC(json.dumps(query, encoding='utf-8')))
writeLog("JSON returns: %s" % (res), level=xbmc.LOGDEBUG)
try:
if 'result' in res and 'tvshows' in res['result']:
res = res['result']['tvshows']
for tvshow in res:
if tvshow['label'] == tvshowname:
return tvshow['tvshowid']
return False
except Exception:
writeLog("JSON query returns an error", level=xbmc.LOGDEBUG)
return False
but it allways returning "FALSE" but it's for sure that the tvshow is in the db...
I don't know were I'm wrong...