What is the purpose of addon.xml optional imports
#1
I was wondering what the purpose/function of setting the 'optional' attribute to true on an <import> tag in the <requires> section.

My assumption (and what I wanted to happen) was that it would import the addon if it was available, but otherwise continue to install if not. This does not seem to be the case, and I can't seem to find out what it actually does.

Thanks for any help.
Reply
#2
The requirement may be made optional by setting the optional attribute to true. This will only install the dependency when the depending addon actually needs it. If this dependency is missing the depending addon will still be able to be installed.

From the wiki
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
(2013-03-11, 23:02)Martijn Wrote: The requirement may be made optional by setting the optional attribute to true. This will only install the dependency when the depending addon actually needs it. If this dependency is missing the depending addon will still be able to be installed.

From the wiki

Smile That wasn't in the wiki last time I looked.
I still don't see how this would work. I know that if I try to open a plugin url (plugin://addon.whatever) that XBMC will ask if I want to install the addon. In this case the optional="true" addition would have no function other than informative.
But if I try to import a module from the addon, this does not trigger an install of the addon (I tested this)

So I'm still wondering if adding it actually does anything, and what that might be.

(2013-03-11, 23:02)Martijn Wrote: This will only install the dependency when the depending addon actually needs it.
What does this mean? XBMC will install it, the addon code will somehow trigger an install?

Thanks again.
Reply

Logout Mark Read Team Forum Stats Members Help
What is the purpose of addon.xml optional imports0