我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用xbmcplugin.setPluginFanart()。
def add_item( action="" , title="" , plot="" , url="" , thumbnail="" , fanart="" , show="" , episode="" , extra="", page="", info_labels = None, isPlayable = False , folder=True ): _log("add_item action=["+action+"] title=["+title+"] url=["+url+"] thumbnail=["+thumbnail+"] fanart=["+fanart+"] show=["+show+"] episode=["+episode+"] extra=["+extra+"] page=["+page+"] isPlayable=["+str(isPlayable)+"] folder=["+str(folder)+"]") listitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail ) if info_labels is None: info_labels = { "Title" : title, "FileName" : title, "Plot" : plot } listitem.setInfo( "video", info_labels ) if fanart!="": listitem.setProperty('fanart_image',fanart) xbmcplugin.setPluginFanart(int(sys.argv[1]), fanart) if url.startswith("plugin://"): itemurl = url listitem.setProperty('IsPlayable', 'true') xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder) elif isPlayable: listitem.setProperty("Video", "true") listitem.setProperty('IsPlayable', 'true') itemurl = '%s?action=%s&title=%s&url=%s&thumbnail=%s&plot=%s&extra=%s&page=%s' % ( sys.argv[ 0 ] , action , urllib.quote_plus( title ) , urllib.quote_plus(url) , urllib.quote_plus( thumbnail ) , urllib.quote_plus( plot ) , urllib.quote_plus( extra ) , urllib.quote_plus( page )) xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder) else: itemurl = '%s?action=%s&title=%s&url=%s&thumbnail=%s&plot=%s&extra=%s&page=%s' % ( sys.argv[ 0 ] , action , urllib.quote_plus( title ) , urllib.quote_plus(url) , urllib.quote_plus( thumbnail ) , urllib.quote_plus( plot ) , urllib.quote_plus( extra ) , urllib.quote_plus( page )) xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder)
def add_item( action="" , title="" , plot="" , url="" , thumbnail="" , fanart="" , show="" , episode="" , extra="", category="", page="", info_labels = None, context_menu_items = [] , isPlayable = False , folder=True ): _log("add_item action=["+action+"] title=["+title+"] url=["+url+"] thumbnail=["+thumbnail+"] fanart=["+fanart+"] show=["+show+"] episode=["+episode+"] extra=["+extra+"] category=["+category+"] page=["+page+"] isPlayable=["+str(isPlayable)+"] folder=["+str(folder)+"]") listitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail ) if info_labels is None: info_labels = { "Title" : title, "FileName" : title, "Plot" : plot } listitem.setInfo( "video", info_labels ) if len(context_menu_items)>0: listitem.addContextMenuItems ( context_menu_items, replaceItems=False) if fanart!="": listitem.setProperty('fanart_image',fanart) xbmcplugin.setPluginFanart(int(sys.argv[1]), fanart) if url.startswith("plugin://"): itemurl = url listitem.setProperty('IsPlayable', 'true') xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder) elif isPlayable: listitem.setProperty("Video", "true") listitem.setProperty('IsPlayable', 'true') itemurl = '%s?action=%s&title=%s&url=%s&thumbnail=%s&fanart=%s&plot=%s&extra=%s&category=%s&page=%s' % ( sys.argv[ 0 ] , action , urllib.quote_plus( title ) , urllib.quote_plus(url) , urllib.quote_plus( thumbnail ) , urllib.quote_plus( fanart ) , urllib.quote_plus( plot ) , urllib.quote_plus( extra ) , urllib.quote_plus( category ) , urllib.quote_plus( page )) xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder) else: itemurl = '%s?action=%s&title=%s&url=%s&thumbnail=%s&fanart=%s&plot=%s&extra=%s&category=%s&page=%s' % ( sys.argv[ 0 ] , action , urllib.quote_plus( title ) , urllib.quote_plus(url) , urllib.quote_plus( thumbnail ) , urllib.quote_plus( fanart ) , urllib.quote_plus( plot ) , urllib.quote_plus( extra ) , urllib.quote_plus( category ) , urllib.quote_plus( page )) xbmcplugin.addDirectoryItem( handle=int(sys.argv[1]), url=itemurl, listitem=listitem, isFolder=folder)
def system(self, data, cl=False): util.debug("[SC] SYSYEM CL: %s" % str(cl)); if cl is False and "setContent" in data: xbmcplugin.setContent(int(sys.argv[1]), data["setContent"]) ''' view_mode=data["setContent"].lower() skin_name=xbmc.getSkinDir() # nacitame meno skinu util.debug("[SC] skin_name='"+skin_name+"'") try: util.debug("[SC] view mode is "+view_mode) view_codes=sctop.ALL_VIEW_CODES.get(view_mode) view_code=view_codes.get(skin_name) util.debug("[SC] view code for "+view_mode+" in "+skin_name+" is "+str(view_code)) xbmc.executebuiltin("Container.SetViewMode("+str(view_code)+")") #xbmc.executebuiltin("Container.Refresh") except: util.debug("[SC] Unable to find view code for view mode "+str(view_mode)+" and skin "+skin_name) ''' if cl is False and "setPluginCategory" in data: xbmcplugin.setPluginCategory(int(sys.argv[1]), data["setPluginCategory"]) if cl is False and "addSortMethod" in data: xbmcplugin.addSortMethod(int(sys.argv[1]), sctop.sortmethod[int(data["addSortMethod"])]) if cl is False and data.get('addSortMethods'): for m in data.get("addSortMethods"): xbmcplugin.addSortMethod(int(sys.argv[1]), sctop.sortmethod[int(m)]) if cl is False and "setPluginFanart" in data: xbmcplugin.setPluginFanart(int(sys.argv[1]), data["setPluginFanart"]) if cl is False and "version" in data: util.info("[SC] kontrola verzie: %s %s" % (str(sctop.addonInfo('version')), data["version"])) if sctop.addonInfo('version') != data["version"] and sctop.getSetting('ver') != data['version']: try: sctop.dialog.ok(sctop.getString(30954), sctop.getString(30955) % str(data['version'])) except: pass xbmc.executebuiltin('UpdateAddonRepos') sctop.setSetting('ver', data['version']) if sctop.getSettingAsBool('cachemigrate') == '' or sctop.getSettingAsBool('cachemigrate') is False: self.parent.cacheMigrate() pass pass if cl is False and "focus" in data: self.parent.system = {"focus": data['focus']} if cl is True and "focus" in data: try: self.parent.endOfDirectory() util.debug("[SC] nastavujem focus na: %d" % int(data['focus'])) xel = xbmcgui.Window(xbmcgui.getCurrentWindowId()) ctr = xel.getControl(xel.getFocusId()) ctr.selectItem(int(data['focus'])) except Exception, e: util.debug("[SC] error focus :-( %s" % str(traceback.format_exc())) pass