2016-10-20, 10:08
I'm trying to write my first KODI plugin (something similar to favorites) and so far so good except for 1 thing.
I have been stuck on this for a few days now, I simply can't figure out how to get the URL of a movie in the script that is called from a Context Menu item.
My addon.xml has this in it:
And the capture.py script gets called no problem.
The main part of capture.py looks like this:
Which all works great... but how do I get the URL of the movie so I can use it again later when I create a DirectoryItem?
I've been Googling non stop with little success.. I found a lot of references here on the forums to ListItem.FileNameAndPath but that doesn't seem to exist anymore, I found that mostly in older posts.
I think I'm missing something really obvious here, can anyone help?
Thanks in advance
I have been stuck on this for a few days now, I simply can't figure out how to get the URL of a movie in the script that is called from a Context Menu item.
My addon.xml has this in it:
Code:
<extension point="kodi.context.item" library="capture.py">
<item>
<label>Add to Shortlist</label>
<visible>Container.Content(movies)</visible>
</item>
</extension>
And the capture.py script gets called no problem.
The main part of capture.py looks like this:
Code:
if __name__ == '__main__':
videoInfoTag = sys.listitem.getVideoInfoTag()
item = ShortlistItem()
item.title = sys.listitem.getLabel()
item.duration = sys.listitem.getduration()
item.rating = videoInfoTag.getRating()
item.year = videoInfoTag.getYear()
item.date = videoInfoTag.getPremiered()
item.thumb = sys.listitem.getArt( 'thumb' )
item.poster = sys.listitem.getArt( 'poster' )
addToShortlist( item )
Which all works great... but how do I get the URL of the movie so I can use it again later when I create a DirectoryItem?
I've been Googling non stop with little success.. I found a lot of references here on the forums to ListItem.FileNameAndPath but that doesn't seem to exist anymore, I found that mostly in older posts.
I think I'm missing something really obvious here, can anyone help?
Thanks in advance