2008-10-28, 04:26
Basically it's to add a video link to a list:
If the Image parameter is null then it displays the DefaultVideo.png image fine. But the parameter actually has an image filename input then it displays nothing.
I have checked and the image does exist in the folder: %plugin_dir%\images\. Have tried another image too just to make sure it isn't the image.
Also made sure I imported os & os.path.
What am I doing wrong? Syntax error? (This is my first hour of python )
Thanks.
Code:
def AddListItem (Name, Url, Image):
if (Image == ""):
Image = "DefaultVideo.png"
else:
Image = str (os.path.join (os.getcwd (), 'images', Image))
guiListItem = xbmcgui.ListItem (Name, Image, Image)
guiListItem.setInfo (type = "Video", infoLabels = {"Title": Name})
success = xbmcplugin.addDirectoryItem (int (sys.argv[1]), Url, guiListItem)
return success
If the Image parameter is null then it displays the DefaultVideo.png image fine. But the parameter actually has an image filename input then it displays nothing.
I have checked and the image does exist in the folder: %plugin_dir%\images\. Have tried another image too just to make sure it isn't the image.
Also made sure I imported os & os.path.
What am I doing wrong? Syntax error? (This is my first hour of python )
Thanks.