2017-07-31, 02:55
I have an addon with a service, the service run while a user is logged in using this in the addon.xml
The service should be running all the time while the user is logged into Kodi.
I was told to use the in my service loop
However, I have noticed that .abortRequested() can return true when an addon action is stopped, i.e. you call the addon to show a list if ListItems and as it is doing that you hit backspace, this cansels the addon call but triggers a global abort requested action which triggers the service monitor instance and the service also exists.
Should this be how monitor.abortRequested() works?
In a service should I be using a different abort requested mechanism?
Code:
<extension point="xbmc.service" library="service.py" start="login">
The service should be running all the time while the user is logged into Kodi.
I was told to use the in my service loop
Code:
xbmc_monitor = xbmc.Monitor()
while not xbmc_monitor.abortRequested():
<do servisy stuff here>
xbmc_monitor.waitForAbort(1)
However, I have noticed that .abortRequested() can return true when an addon action is stopped, i.e. you call the addon to show a list if ListItems and as it is doing that you hit backspace, this cansels the addon call but triggers a global abort requested action which triggers the service monitor instance and the service also exists.
Should this be how monitor.abortRequested() works?
In a service should I be using a different abort requested mechanism?