Looks like the new
xml:
$INFO[listitem.property(mypicsdb_person)]
works perfectly fine in the context of list items, i.e. when showing a list of photos.
I have edited AppData\Roaming\Kodi\addons\skin.confluence\720p\ViewsPictures.xml by replacing the label for the picture resolution:
xml:
<label>$INFO[ListItem.PictureResolution,$LOCALIZE[31327] - ]</label>
with:
xml:
<label>$INFO[listitem.property(mypicsdb_person)]</label>
Then navigated to a list of photos within MyPicsDB plugin, and selected the "Pic thumbs" view mode on the left. When hovering the mouse over photo thumbnails, the photo preview on the right shows the correct people for each photo.
As far as I understand, Slideshow does not use listitems, but a specific set of Slideshow info labels (
https://kodi.wiki/view/InfoLabels#Slideshow) that are set by Kodi's
https://github.com/xbmc/xbmc/blob/master...anager.cpp. I suppose the ultimate solution would be a pull request for GUIInfoManager.cpp to read XMP tags and populate them as Slideshow.* labels, but this most likely falls outside the scope of your plugin
I tried to use the new MPDB.get_pic_persons() in the following two scenarios, but failed in both:
- populate WINDOW property for each photo during listitem generation in default.py:
python:
persons = MPDB.get_pic_persons(picpath,picname)
WINDOW = xbmcgui.Window( 10000 )
WINDOW.setProperty ( picname, persons )
common.log("Main.add_picture: window", WINDOW.getProperty(picname))
liz.setProperty('mypicsdb_person', persons )
liz.setInfo( type="pictures", infoLabels=infolabels
Then trying to use it in SlideShow.xml:
xml:
<label>$INFO[Window(10000).Property(Slideshow.Filename)]</label>
Result: nothing gets displayed during Slideshow.
I suppose I lack knowledge about how Slideshow uses such custom Window objects from Kodi, because some predefined ones are displayed just fine.
- exposing MPDB.get_pic_persons() outside the plugin, again in default.py:
python:
def getpersons(self):
picpath = m.args.picpath
picname = m.args.picname
common.log("getpersons args: ", picpath, picname)
persons = MPDB.get_pic_persons(picpath,picname)
common.log("getpersons db result: ", persons)
return persons
and
python:
elif m.args.action=='getpersons':
m.getpersons()
Then trying to call it using
xml:
RunScript(plugin.image.mypicsdb2,0,?action='getpersons'&picpath=$INFO[Slideshow.Path]&picname=$INFO[Slideshow.Filename])
in <label> in Slideshow.xml.
Result: "0" displayed as label and nothing logged by default.py in the log, i.e. I lack knowledge about how to use RunScript in <label>.
Any suggestions how to make these work?