Posts: 1,506
Joined: Nov 2013
You want just pluginsource.
The abstraction is a virtual filesystem. The plugin can return directories (calls to itself with particular parameters), playable files or just files which is the hook to do 'stuff' which does not generate a new listing, such as show a dialog, search etc.
If this abstraction is not appripriate, you want to do a script instead. This is a fullblown window, with full customization of the gui components and such. More work.
the library extension point is for code shared between multiple pluginsources and/or scripts. It is not related to the media library interpretation of the term library
Posts: 143
Joined: Feb 2017
Reputation:
0
So basically I should recognize context myself by examining sys.argv[1] - if it's empty, it's a $ADDON[script.module.stiff] call, if not and it doesn't look like a handle, it's a $ADDON[script.module.stiff arg1 arg2] call, otherwise it's a plugin://script.module.stiff?param=value call - right?
Posts: 143
Joined: Feb 2017
Reputation:
0
OK, it's now clear enough, thanks.
Posts: 143
Joined: Feb 2017
Reputation:
0
2017-06-05, 21:33
(This post was last modified: 2017-06-05, 21:35 by baza_dwa.)
Any idea why the xml definition below gives error "RunScript called for a non-script addon 'script.stiff'. This behaviour is deprecated.":
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <addon id="script.stiff" name="stiff" version="0.0.1" provider-name="stiffauthor">
- <requires>
<import addon="xbmc.python" version="2.25.0" />
</requires>
- <extension point="xbmc.python.pluginsource" library="addon.py">
<provides>audio image video</provides>
</extension>
- <extension point="xbmc.addon.metadata">
<summary>Stiff skin support module</summary>
<description>Stiff skin support module</description>
<platform>all</platform>
<license>ala</license>
</extension>
</addon>
Posts: 143
Joined: Feb 2017
Reputation:
0
2017-06-05, 23:35
(This post was last modified: 2017-06-06, 00:00 by baza_dwa.)
This is not the case... I've changed all 'script.' to '.plugin.', including file names and entries in addon.xml, and it's still the same.
OK, RunAddon seems to work, it even supports parameters, but the error is now:
23:42:47.384 T:5964 ERROR: Control 55 in window 10025 has been asked to focus, but it can't
23:42:47.724 T:5964 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.stiff/?ala=makota
23:42:47.724 T:5964 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.stiff/?ala=makota) failed
while the whole script is
import xbmc
import xbmcgui
import xbmcplugin
xbmc.log('XXX: '+sys.argv[1])
And it messes with Control 55 in window 10025 anyways (ie. my properly working view in MyVideoNav), setting its contents to videodb://movies/ or something similar instead of library://video/movies/anime.xml being displayed) when called as RunAddon(plugin.stiff,ala=makota) in <onclick> for a button in this window...
Posts: 1,506
Joined: Nov 2013
read some tutorial. you are not doing anything required by the api. at the very least you need a call to xbmcplugin.endOfDirectory(). you have 100's of examples. look at one of them! each and every one will show that you have to follow the api to get things done.
Posts: 1,506
Joined: Nov 2013
i totally agree that documentation is suboptimal which is why i pointed you to the 100's of existing plugins (monkey see, monkey do).
setContent controls the available sort and view modes. i'm not sure what you fear is changed by it, but that's all it does.
Posts: 143
Joined: Feb 2017
Reputation:
0
My question for setContents() was about what happens if addon is called not from a list or list-like element. It seems it updates whatever list is available at hand.
I was in MyVideoNav displaying movies in a container and also having a separate button with addon call in <onclick> (experimenting setup). Clicking the button caused updating the container.
Thanks for all the efforts to make things more clear, they are really helpful.
I miss the most general articles, like the one linked.
The next hurdle before me: how to discretionary filter views in MyVideoNav (and similar windows) - without calling all these dialogs inbetween - imagine a button "Action" - you click it and the view gets filtered with genre Action....