common.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:plugin.video.amazon65 作者: phil65 项目源码 文件源码
def addDir(name, mode, sitemode, url='', thumb='', fanart='', infoLabels=False, totalItems=0, cm=False, page=1, options=''):
    u = '%s?url=<%s>&mode=<%s>&sitemode=<%s>&name=<%s>&page=<%s>&opt=<%s>' % (sys.argv[0], urllib.quote_plus(url), mode, sitemode, urllib.quote_plus(name), urllib.quote_plus(str(page)), options)
    if not fanart or fanart == na:
        fanart = def_fanart
    else:
        u += '&fanart=<%s>' % urllib.quote_plus(fanart)
    if not thumb:
        thumb = def_fanart
    else:
        u += '&thumb=<%s>' % urllib.quote_plus(thumb)
    item = xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=thumb)
    item.setArt({'fanart': fanart,
                 'poster': thumb})
    item.setProperty('IsPlayable', 'false')
    try:
        item.setProperty('TotalSeasons', str(infoLabels['TotalSeasons']))
    except Exception:
        pass
    if infoLabels:
        item.setInfo(type='Video', infoLabels=infoLabels)
    if cm:
        item.addContextMenuItems(cm, replaceItems=False)
    xbmcplugin.addDirectoryItem(handle=pluginhandle, url=u, listitem=item, isFolder=True, totalItems=totalItems)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号