Posts: 5,246
Joined: Jul 2012
Reputation:
339
2015-10-27, 00:32
(This post was last modified: 2015-10-27, 00:34 by scott967.)
I guess I don't understand the difference between these and when you should use one or the other. I tried to look through AddonBuiltins.cpp to see what is going on, and from that it seems like RunAddon is maybe a little bit more powerful version of RunPlugin (will activate a window depending on add-on extension point I think else defaults to RunPlugin behavior), but RunScript seems a bit different though I don't understand what the effect of the difference is, except that it does seem like RunScript will allow running of a random .py file that hasn't been "installed" but that isn't preferred. Any help?
scott s.
.
Posts: 6,684
Joined: Mar 2009
Reputation:
147
phil65
Retired Team-Kodi Member
Posts: 6,684
In easy words, RunAddon() will basically automatically call either RunPlugin() or RunScript() based on the addon extension point. Plugins basically provide content for the kodi media windows, scripts often ship their own XML windows.
Posts: 5,246
Joined: Jul 2012
Reputation:
339
Update: So I did some digging around. What I find seems to be that if the skin calls RunPlugin() and the plugin is not installed, CAddonInstaller gets called with InstallModal() with promptForInstall. This raises a diaogYesNo asking user if they want to install the addon. This seems like a useful behavior, but is this intended?
This is prompted by a skin I am maintaining and had a dependency set for an addon that got removed from Kodi repo and this resulted in the skin being marked incompatible. So I was looking at alternatives that would get the addons installed but not prevent the skin from installing. By accident I came across this in a different skin. I see also the option of the "optional" parameter in the addon.xml. Maybe this is intended to do the same thing?
scott s.
.
Posts: 17,418
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,418
The 'optional' parameter does nothing.