•   
  • 1
  • 13
  • 14
  • 15
  • 16
  • 17(current)
Release script favourites
(2020-07-04, 01:22)ronie Wrote:
(2020-07-03, 21:47)scott967 Wrote: Did a little snooping in the log and I see
Code:
JSONRPC v11.11.0: Successfully initialized
is getting logged after the script runs. 

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.
.
maintainer of skin  Aeon MQ5 mods for post-Gotham Kodi releases:
Matrix
Leia see: 304472
Reply
i would say it's something that should be handled in kodi.
imo addons should not be able to run at all until the json-rpc inference is initialized.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
  •   
  • 1
  • 13
  • 14
  • 15
  • 16
  • 17(current)



Logout Mark Read Team Forum Stats Members Help
script favourites2
This forum uses Lukasz Tkacz MyBB addons.