Insuring only a single instance of an Addon is running(script format) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Insuring only a single instance of an Addon is running(script format) (/showthread.php?tid=97353) |
Insuring only a single instance of an Addon is running(script format) - giftie - 2011-03-21 I know that when an addon is started form the Addons Window, only a single Instance of an Addon can run(XBMC closes any that may be running in the background). When starting an addon through the RunScript() Built-in, multiple versions can be threaded in XBMC. This causes a problem with my script(as only a single instance should be running) Is there a way to test to see if it is already running or even being able to cancel the running addon?? Thanks in advanced. - Ninjamawwe - 2011-07-29 I am interested in the same thing (for the trakt script). - VictorV - 2011-08-06 Should be possible if you listen for app. calls through a socket. Let's say you design the addon in three main parts. caller, manager, application. The caller tries to make a socket connection to the manager. If a connection can be established, the manager send a event message the application. If there are no connection the app. is not running and the call module create a new threaded manager for handling the instance reference for future calls. Code: Caller: - ronie - 2011-08-07 Ninjamawwe Wrote:I am interested in the same thing (for the trakt script). just set (and check for) a window property at startup. here's what i do: PHP Code: if xbmc.getInfoLabel( "Window(10000).Property(MyScriptRunning)" ) == "True": - VictorV - 2011-08-07 Or you can go with a simple soultion as Ronie suggests :p Atleast if you don't need to interact with the application RE: - FreakMurderer - 2019-09-21 (2011-08-07, 03:32)VictorV Wrote: Or you can go with a simple soultion as Ronie suggests :p How close DialogProgressBG from another script? |