Multiple extension points
#1
Hi

I'm trying to figure out the appropriate extension points to get the correct behaviour for my addon between plugin and script extension points. I've tried multiple variations but when I get it behaving properly, it shows up twice in Kodi... Here's where it stands:
  • Service: This is fine
  • Script: In settings XML I need to use RunScript to run configuration scripts for Hue and other required functionality. 
  • Plugin (provides executable) : I wish to add a plugin to allow for shortcuts to trigger the service to perform specific actions. I'm using a plugin because I want to be able to add some of those actions as favourites so users can trigger them easily (see thread)

With this approach, my addon shows up twice under programs. If I remove <script>, is there another approach to calling actions from settings.xml? Right now when I remove it it starts calling the plugin with the sys.args in a different order than when calling the script... My in-progress addon.xml is here
Reply
#2
if you list the service as the first extension point in your addon.xml file, i think RunScript will execute the service instead of the plugin.
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
#3
Thanks Ronie

I put the service extension point first and got rid of the script extension point. The plugin and service work as before and runscript calls the service. I'll need to move those settings actions to my service and make sure it doesn't run multiple instances of my service. Is there a safe way to do that? If I make a service running flag somewhere if Kodi crashes it will probably end up in a bad state. I know we can see running services in the system settings but can't find how to retrieve them. At any rate, how will Kodi know the difference between the same script running as a service or running as a script?
Reply
#4
(2019-10-27, 13:54)Snapcase Wrote: Thanks Ronie

I put the service extension point first and got rid of the script extension point. The plugin and service work as before and runscript calls the service. I'll need to move those settings actions to my service and make sure it doesn't run multiple instances of my service. Is there a safe way to do that? If I make a service running flag somewhere if Kodi crashes it will probably end up in a bad state. I know we can see running services in the system settings but can't find how to retrieve them. At any rate, how will Kodi know the difference between the same script running as a service or running as a script?
Artist Slideshow uses a window property as a flag to tell if it's running. If Kodi crashes this automatically gets wiped out.  But if AS crashes it can leave you in a state where AS thinks it's already running, so you have to restart Kodi.  @ronie probably knows more about that than I do. It's his original code.  '-)
Reply
#5
Thanks! Sounds like the window property flags are pretty useful
Reply

Logout Mark Read Team Forum Stats Members Help
Multiple extension points0