How do we set content type when using subclass of WindowXML
#1
I recently used 

python:
xbmcplugin.addDirectoryItem()
then 
python:
xbmcplugin.endOfDirectory()

But that was taking a while and would not show results until all items had been added.

I then used class GUI( xbmcgui.WindowXML ): and did 
python:
self.addItem()
which added my items lively but I can't figure out how to set the content type for this method

The previous way I would do 
python:
xbmcplugin.setContent(addon_handle, 'movies')
which then allows the window to change views, It also allowed me to use the dbid for displaying the information for such item.

How do I go about setting this content through the extend xbmcgui.WindowXML class? then how would I default the view to a different one other than list?

Cheers.
Reply
#2
Just realised this should be under addon / python development and not jsonrpc. I reported the post as wrong forum to see if a moderator can move it without me having to double post
Reply
#3
Moved
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
@Softvine I think you have to skin it all yourself and thus create whatever view(s) you need.  Certainly, that's what Database-cleaner does.  See https://github.com/the-black-eagle/scrip...window.xml   The class that adds the information to the window is near the top of https://github.com/the-black-eagle/scrip...default.py
Learning Linux the hard way !!
Reply
#5
I just settled with the xbmcplugin way and used addDirectoryItems. Not sure if it's my imagination but seems to be quicker and only taking a second or two to load 900 or so library items so it will suffice for now. I didn't want to get to extreme measures just for something that was already sufficent but better user experience. Its unfortunate because one way so pros and cons and so did the other. Be nice if we could set the content easily (I think it is with Kodi v18 but I'm using v17) through the extended window class method or if the plugin.addDirectoryItem would show results on each insert instead of waiting for all of them to load.
Reply
#6
the content setting is to communicate with the c++ implemented window so it chooses the appropriate view mode from the skin (among other things). setting it for windowxml makes no sense - you are implementing the window yourself - so *you* have to invent whatever viewtypes you may want to support.
Reply
#7
(2018-10-01, 12:26)spiff Wrote: the content setting is to communicate with the c++ implemented window so it chooses the appropriate view mode from the skin (among other things). setting it for windowxml makes no sense - you are implementing the window yourself - so *you* have to invent whatever viewtypes you may want to support.
 Not sure why it makes no sense when it's a method coming 'setContent' in v18. I'm also loading the MyVideoNav.xml which defaults to the skins xml file and I'm choosing this because the WindowXML class seems to add items instantly (one by one) as they go through 'addItem'. the generic xbmcplugin addDirectoryItem does not do this, it instead waits for all the items to be processed then we call 'endOfDirectory' which will then display the items. Set content is not reliant on the views or vise versa but the skin I'm using does check the content type to determine whether certain views should be available. It is also in fact for the items to understand that they should display as a library item or whatever based on DBID instead of a generic file item.
Reply
#8
nothing will use the value, that's why it makes no sense. you may be loading the xml but you do not have the backing *CODE* that use that setting for anything.

a plugin is virtual filesystem entry. it's listed in the media window like any other directory, and thus can use the content functionality of the media window.
when you instead use windowxml you are writing your own window.  see?
Reply

Logout Mark Read Team Forum Stats Members Help
How do we set content type when using subclass of WindowXML0