2020-07-05, 22:40
(2020-07-04, 01:22)ronie Wrote:(2020-07-03, 21:47)scott967 Wrote: Did a little snooping in the log and I see
is getting logged after the script runs.Code:JSONRPC v11.11.0: Successfully initialized
yeah, that could indeed be the issue. if json is not up-and-running, i guess all addons that make a json-rpc request will fail.
i did some testing and i can reproduce it... even with older nightlies from 6 months ago.
could you create an issue for it? https://github.com/xbmc/xbmc/issues
Not sure how best to handle this -- in addon or kodi?
did this to work around
Code:
def _get_favs(self):
data = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Favourites.GetFavourites", "params":{"properties":["window", "windowparameter", "thumbnail", "path"]}, "id":1}')
favs = json.loads(data)
log('favs: ' + repr(favs))
monitor = xbmc.Monitor()
for retry in range(3):
if 'error' in favs:
log('json-rpc not up -- try again in one sec')
monitor.waitForAbort(1)
data = xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Favourites.GetFavourites", "params":{"properties":["window", "windowparameter", "thumbnail", "path"]}, "id":1}')
favs = json.loads(data)
log('retry ' + str(retry) + ' favs: ' + repr(favs))
else:
log('got json-rpc result')
return favs['result']['favourites']
log('tried to get json-rpc 3 times -- giving up')
return
seems like it would be better if kodi returned an error that specified the interface was not initialized.
scott s.
.