v17 How to get make Author and Date show up in listview
#1
I'm not sure if this is better-suited for the skinning sub-forum of Development, but I figured I'd start here. If it is I don't mind it being moved at all. I've been building an add-on in my free time that I hope to eventually submit to the official repo (waaayyy down the road) and I'm having some trouble with getting the view I would like to display all my listitem details to show any information aside from the actual list. I'm trying to get the Media Info setup

Image

(as found on the Video Navigation wiki page). First thing I should mention is that my addon is a program addon, not a video addon. Will that make a difference? Will that prevent me from being able to accomplish this? I use the following code to set the addon's content-type to movies in hopes of utilizing the view

Code:
# Get the plugin url in plugin:// notation.
_url = sys.argv[0]
# Get the plugin handle as an integer number.
_handle = int(sys.argv[1])
xbmcplugin.setContent(_handle, 'movies')

Secondly, I know that layouts are dependent upon the skin the user is currently using. I'm currently using the stock Krypton skin (forget the name) and I also have Xonfluence to test with. Shouldn't the Krypton default skin have this view? Below is what my menu is currently looks like
Image
However, I've tried placing a test Date on all of the listitems to see if it would show up in the pane on the right side of the screen, but no luck.

Code:
for item in notifications:
    if reasons[item['reason']] == 'show':
        list_item = xbmcgui.ListItem(label=item['subject']['title'])
                    
        list_item.setInfo('date', '2017-05-22 15:39:30')
                    
        url = get_url(action='view_notification',choice=item['id'], url=item['subject']['url'])
        is_folder = True
        xbmcplugin.addDirectoryItem(_handle, url, list_item, is_folder)
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_NONE)

Do I need to do something else to make it show up on the right-hand side of the screen? I'd like to have it display the author, date, and a short summary that I'd create on the fly.
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Reply
#2
program addons are "script", video,pictures,music addons are "plugin".

Kodi does not give you a handle id on argv[1] for program addons
I don't know how you you got xbmcplugin working. (I couldn't get this to work during the Isengard days)

kodi remotes(kore,yatse) call the youtube plugin to play a video.
scripts cannot be called like this

as for making it show up on the right-hand side of the screen,
most skins will show the 'plot' in setinfo.
hammer the author, date and short summary into a string and put it in 'plot'
Reply
#3
Weird, mine's working fine as "plugin.program.Mega2" and the handle is also working fine I presume because I haven't had any issues with it.

As for using 'plot' in setinfo, just tried it, but didn't work Sad Any other ideas?

Used the following added line to test your suggestion
Code:
list_item.setInfo('plot', 'Test 123')
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Reply
#4
I've also tried adding 'video' data to the list item to no avail

Code:
info = {
      'genre': 'Horror',
      'year': 1979,
      'title': 'Alien',
}
list_item.setInfo('video', info)
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Reply
#5
it has something to do with the pluginsource in addon.xml
plugins look like this:
Code:
    <extension point="xbmc.python.pluginsource" library="default.py">
        <provides>video</provides>
    </extension>
Make sure having "video" in the <provides>

skins check what kind of plugin it is displaying and show the infolabels accordingly.
Reply
#6
(2017-05-30, 04:35)gedisony Wrote: it has something to do with the pluginsource in addon.xml
plugins look like this:
Code:
    <extension point="xbmc.python.pluginsource" library="default.py">
        <provides>video</provides>
    </extension>
Make sure having "video" in the <provides>

skins check what kind of plugin it is displaying and show the infolabels accordingly.

Ahh that makes sense, right now I have mine as 'executable'. Will changing it to 'video' change anything else, like which menu (Programs or Videos) it shows under? Or is it possible to have multiple types in the provides tag?
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Reply
#7
Changing it to video will make it show up on the video addons section.
You can have multiple types in there and your addon will show up on different places.
Kodi will add a content_type in the argv[2] parameters when your plugin is first run to let you know from where it was called.
I don't know about 'executable', but the plugin behaves differently when started as, for example; an image addon. (if you have a <provides>image</provides>)
I forgot the details, it has something to do with how it handles the listitem.
like it would do a slideshow if it is "image" and call the vieoplayer if it is "video".
and definitely, the skins pick the appropriate infolabels,
Reply
#8
That makes a lot of sense. Thank you so much for explaining it so clearly! I've been going crazy trying to find this mentioned in the documentation. Maybe I just missed it or maybe I needed it more simply put. I'll mess around with the provides tag and continue messing with the setinfo while keeping this in mind.
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Reply

Logout Mark Read Team Forum Stats Members Help
How to get make Author and Date show up in listview0