xbmc.Monitor().abortRequested()
#1
I have an addon with a service, the service run while a user is logged in using this in the addon.xml

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?
Reply
#2
I observed similar behavior and submitted a ticket to Kodi. My guess is it's a bug.

https://forum.kodi.tv/showthread.php?tid=317384

Sent from my SM-G935T
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
I found if I go back to my original way

Code:
if xbmc.abortRequested:
   <do service stuff>
   xbmc_monitor.waitForAbort(1)

then it works as intended.
Reply
#4
(2017-07-31, 08:26)null_pointer Wrote: I found if I go back to my original way

Code:
if xbmc.abortRequested:
   <do service stuff>
   xbmc_monitor.waitForAbort(1)

then it works as intended.

This isn't a loop unless you left something out Smile
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
Code:
while not xbmc.abortRequested:
   <do service stuff>
   xbmc.sleep(1000)
Reply
#6
(2017-08-01, 00:05)null_pointer Wrote:
Code:
while not xbmc.abortRequested:
   <do service stuff>
   xbmc.sleep(1000)
Yeah your bypassing the problem area...Smile
I believe it's a bug with waitforabort.

Sent from my SM-G935T
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#7
PR11852, and fixed in Kodi 18.

Hasn't yet been backported to Kodi 17.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#8
(2017-08-01, 03:51)Milhouse Wrote: PR11852, and fixed in Kodi 18.

Hasn't yet been backported to Kodi 17.

Thanks for the heads up...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#9
Is this going to be backported? It looks like the fix was added back in Mar, this might have even made the 17.3 build if it was backported back then.
Reply
#10
PR12610.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.Monitor().abortRequested()0