From e887e7162b3661d69c0cb02b8b9a51a5bc7ba37a Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 24 Jan 2021 15:01:55 +0100 Subject: [PATCH] Fix pictures from Plex picture libraries not working/displaying --- resources/lib/widgets.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/lib/widgets.py b/resources/lib/widgets.py index fbc6487c..a4880181 100644 --- a/resources/lib/widgets.py +++ b/resources/lib/widgets.py @@ -472,16 +472,18 @@ def create_listitem(item, as_tuple=True, offscreen=True, elif "plugin://script.skin.helper" not in item['file']: liz.setProperty('IsPlayable', 'true') - nodetype = "Video" if item["type"] in ["song", "album", "artist"]: nodetype = "music" + elif item['type'] == 'photo': + nodetype = 'pictures' + else: + nodetype = 'video' # extra properties for key, value in item["extraproperties"].iteritems(): liz.setProperty(key, value) - # video infolabels - if nodetype == "Video": + if nodetype == 'video': infolabels = { "title": item.get("title"), "size": item.get("size"), @@ -552,12 +554,18 @@ def create_listitem(item, as_tuple=True, offscreen=True, if "lastplayed" in item: 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 # PKC hack: ignore empty type if item["type"] not in ["recording", "channel", "favourite", ""]: infolabels["mediatype"] = item["type"] # 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"] if "lastplayed" in item: