Fix pictures from Plex picture libraries not working/displaying

This commit is contained in:
croneter 2021-01-24 15:01:55 +01:00
parent 9d02e19a68
commit dd70170caa

View file

@ -462,16 +462,18 @@ def create_listitem(item, as_tuple=True, offscreen=True,
elif "plugin://script.skin.helper" not in item['file']: elif "plugin://script.skin.helper" not in item['file']:
liz.setProperty('IsPlayable', 'true') liz.setProperty('IsPlayable', 'true')
nodetype = "Video"
if item["type"] in ["song", "album", "artist"]: if item["type"] in ["song", "album", "artist"]:
nodetype = "music" nodetype = "music"
elif item['type'] == 'photo':
nodetype = 'pictures'
else:
nodetype = 'video'
# extra properties # extra properties
for key, value in item["extraproperties"].items(): for key, value in item["extraproperties"].items():
liz.setProperty(key, value) liz.setProperty(key, value)
# video infolabels if nodetype == 'video':
if nodetype == "Video":
infolabels = { infolabels = {
"title": item.get("title"), "title": item.get("title"),
"size": item.get("size"), "size": item.get("size"),
@ -542,12 +544,18 @@ def create_listitem(item, as_tuple=True, offscreen=True,
if "lastplayed" in item: if "lastplayed" in item:
infolabels["lastplayed"] = item["lastplayed"] infolabels["lastplayed"] = item["lastplayed"]
else:
# Pictures
infolabels = {
"title": item.get("title"),
'picturepath': item['file']
}
# setting the dbtype and dbid is supported from kodi krypton and up # setting the dbtype and dbid is supported from kodi krypton and up
# PKC hack: ignore empty type # PKC hack: ignore empty type
if item["type"] not in ["recording", "channel", "favourite", ""]: if item["type"] not in ["recording", "channel", "favourite", ""]:
infolabels["mediatype"] = item["type"] infolabels["mediatype"] = item["type"]
# setting the dbid on music items is not supported ? # setting the dbid on music items is not supported ?
if nodetype == "Video" and "DBID" in item["extraproperties"]: if nodetype == "video" and "DBID" in item["extraproperties"]:
infolabels["dbid"] = item["extraproperties"]["DBID"] infolabels["dbid"] = item["extraproperties"]["DBID"]
if "lastplayed" in item: if "lastplayed" in item: