Depricate listitem.setThumbnailImage and listItem.setIconImage

This commit is contained in:
croneter 2020-12-19 07:28:10 +01:00
parent dcd6756a7d
commit a56655356c
2 changed files with 8 additions and 13 deletions

View file

@ -86,12 +86,10 @@ def directory_item(label, path, folder=True):
Adds a xbmcplugin.addDirectoryItem() directory itemlistitem Adds a xbmcplugin.addDirectoryItem() directory itemlistitem
""" """
listitem = ListItem(label, path=path) listitem = ListItem(label, path=path)
listitem.setThumbnailImage(
"special://home/addons/plugin.video.plexkodiconnect/icon.png")
listitem.setArt( listitem.setArt(
{"fanart": "special://home/addons/plugin.video.plexkodiconnect/fanart.jpg"}) {'landscape':'special://home/addons/plugin.video.plexkodiconnect/fanart.jpg',
listitem.setArt( 'fanart': 'special://home/addons/plugin.video.plexkodiconnect/fanart.jpg',
{"landscape":"special://home/addons/plugin.video.plexkodiconnect/fanart.jpg"}) 'thumb': 'special://home/addons/plugin.video.plexkodiconnect/icon.png'})
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
url=path, url=path,
listitem=listitem, listitem=listitem,

View file

@ -229,7 +229,7 @@ DUMMY_LIST_ITEM = xbmcgui.ListItem()
class ManagedListItem(object): class ManagedListItem(object):
def __init__(self, label='', label2='', iconImage='', thumbnailImage='', def __init__(self, label='', label2='', iconImage='', thumbnailImage='',
path='', data_source=None, properties=None): path='', data_source=None, properties=None):
self._listItem = xbmcgui.ListItem(label, label2, iconImage, thumbnailImage, path) self._listItem = xbmcgui.ListItem(label, label2, path)
self.dataSource = data_source self.dataSource = data_source
self.properties = {} self.properties = {}
self.label = label self.label = label
@ -277,8 +277,8 @@ class ManagedListItem(object):
self.listItem.setProperty('__ID__', self._ID) self.listItem.setProperty('__ID__', self._ID)
self.listItem.setLabel(self.label) self.listItem.setLabel(self.label)
self.listItem.setLabel2(self.label2) self.listItem.setLabel2(self.label2)
self.listItem.setIconImage(self.iconImage) self.listItem.setArt({'thumb': self.thumbnailImage,
self.listItem.setThumbnailImage(self.thumbnailImage) 'icon': self.iconImage})
self.listItem.setPath(self.path) self.listItem.setPath(self.path)
for k in list(self._manager._properties.keys()): for k in list(self._manager._properties.keys()):
self.listItem.setProperty(k, self.properties.get(k) or '') self.listItem.setProperty(k, self.properties.get(k) or '')
@ -331,10 +331,6 @@ class ManagedListItem(object):
def setArt(self, values): def setArt(self, values):
return self.listItem.setArt(values) return self.listItem.setArt(values)
def setIconImage(self, icon):
self.iconImage = icon
return self.listItem.setIconImage(icon)
def setInfo(self, itype, infoLabels): def setInfo(self, itype, infoLabels):
return self.listItem.setInfo(itype, infoLabels) return self.listItem.setInfo(itype, infoLabels)
@ -368,7 +364,8 @@ class ManagedListItem(object):
def setThumbnailImage(self, thumb): def setThumbnailImage(self, thumb):
self.thumbnailImage = thumb self.thumbnailImage = thumb
return self.listItem.setThumbnailImage(thumb) self.listItem.setArt({'thumb': self.thumbnailImage,
'icon': self.iconImage})
def onDestroy(self): def onDestroy(self):
pass pass