xbmc.Monitor abortRequested waitForAbort why works only on service instance?
#1
I came across something in the past that i thought worked

on service side to check if kodi request an abort action (e.g. to Kodi close)
you can use example:


monitor = xbmc.Monitor()
while not monitor.abortRequested():
   if monitor.waitForAbort(1):
       break

then you can stop your looped code.

But if you try to use same code on an add-on instance or script instance
the methods abortRequested, waitForAbort not works at all

I found only the solution to encaplusate the Monitor interface to a python class,
and verify the onNotification events to check when kodi will be terminated:


def onNotification(self, sender, method, data):
    if method in ['System.OnQuit', 'System.OnRestart', 'System.OnSleep']:
        self.is_abort_requested = True

are there or will there be better solutions?
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply
#2
I use basically the same example you say isn’t working in Artist Slideshow with no problems.
Reply
#3
Try this addon test:
http://www.mediafire.com/file/qflumstj8j...n.zip/file

Run the add-on then
when loading window is on screen close Kodi without using a "back" key on loading screen

so then you can use example:
json rpc
Code:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "Application.Quit", "id":1}' -H 'content-type: application/json;' http://192.168.2.2:8080/jsonrpc --user kodi:kodi

or if you are on window try close the kodi window with "X" button

or you can also open the "Shutdown menu" and do Exit

then you can see that the loop code not exit and Kodi is in a freeze state (see task manager)
that will never be terminated
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply



Logout Mark Read Team Forum Stats Members Help
xbmc.Monitor abortRequested waitForAbort why works only on service instance?0
This forum uses Lukasz Tkacz MyBB addons.