2018-08-26, 07:39
For anybody trying to do this by iterating variables, I finally managed to do it, here's how I did it.
All you need is to make a for with 2 variables.
All you need is to make a for with 2 variables.
Code:
.
.
.
categories = get_categories()
numbers = [0, 1, 2]
# Iterate through categories
for category, number in zip(categories, numbers):
# Create a list item with a text label and a thumbnail image.
list_item = xbmcgui.ListItem(label=category)
# Set graphics (thumbnail, fanart, banner, poster, landscape etc.) for the list item.
# Here we use the same image for all items for simplicity's sake.
# In a real-life plugin you need to set each image accordingly.
list_item.setArt({'thumb': 'special://home/addons/plugin.video.myaddon/resources/icon' + str(number) + '.png',
'icon': 'special://home/addons/plugin.video.myaddon/resources/icon' + str(number) + '.png',
'fanart': 'special://home/addons/plugin.video.myaddon/resources/media/background.jpg'})
.
.
.