2018-08-20, 10:47
Hello, can you help me making every category's thumb and fanart different?
I believe that my problem is that the code is inside a for loop. The loop gets the first thumb of each category, but what I want is the loop to get different files, for example icon1.png, icon2.png, icon3.png.
I have tried this for the thumb but I can't get the for to increment the values:
Is there a better way of doing it or can you help me fix the problem with my code?
I believe that my problem is that the code is inside a for loop. The loop gets the first thumb of each category, but what I want is the loop to get different files, for example icon1.png, icon2.png, icon3.png.
Code:
# Iterate through categories
for category in categories:
# Create a list item with a text label and a thumbnail image.
list_item = xbmcgui.ListItem(label=category, thumbnailImage=VIDEOS[category][0]['thumb'])
# Set a fanart image for the list item.
# Here we use the same image as the thumbnail for simplicity's sake.
list_item.setProperty('fanart_image', VIDEOS[category][0]['thumb'])
I have tried this for the thumb but I can't get the for to increment the values:
Code:
icons = ++1
list_item = xbmcgui.ListItem(label=category, thumbnailImage='special://home/addons/plugin.video.myaddon/resources/icon' + str(icons) + '.png')
Is there a better way of doing it or can you help me fix the problem with my code?