def addMenuItem(caption, link, icon=None, thumbnail=None, folder=False, fanart=None):
"""
Add a menu item to the xbmc GUI
Parameters:
caption: the caption for the menu item
icon: the icon for the menu item, displayed if the thumbnail is not accessible
thumbail: the thumbnail for the menu item
link: the link for the menu item
folder: True if the menu item is a folder, false if it is a terminal menu item
Returns True if the item is successfully added, False otherwise
"""
#listItem = xbmcgui.ListItem(unicode(caption), iconImage=icon, thumbnailImage=thumbnail)
listItem = xbmcgui.ListItem(str(caption), iconImage=icon, thumbnailImage=thumbnail)
listItem.setInfo(type="Game", infoLabels={ "Title": caption })
listItem.setProperty('fanart_image', fanart)
return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=link, listitem=listItem, isFolder=folder)
评论列表
文章目录