本文整理汇总了Python中xbmcplugin.SORT_METHOD_EPISODE属性的典型用法代码示例。如果您正苦于以下问题:Python xbmcplugin.SORT_METHOD_EPISODE属性的具体用法?Python xbmcplugin.SORT_METHOD_EPISODE怎么用?Python xbmcplugin.SORT_METHOD_EPISODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类xbmcplugin
的用法示例。
在下文中一共展示了xbmcplugin.SORT_METHOD_EPISODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish_container
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_EPISODE [as 别名]
def finish_container(self):
if self.params.get('random'):
return
for k, v in self.params.items():
if not k or not v:
continue
try:
xbmcplugin.setProperty(self.handle, u'Param.{}'.format(k), u'{}'.format(v)) # Set params to container properties
except Exception as exc:
utils.kodi_log(u'Error: {}\nUnable to set Param.{} to {}'.format(exc, k, v), 1)
if self.item_dbtype in ['movie', 'tvshow', 'episode']:
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_EPISODE) if self.item_dbtype == 'episode' else None
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_LASTPLAYED)
xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)
xbmcplugin.endOfDirectory(self.handle, updateListing=self.updatelisting)
示例2: add_sort_methods
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_EPISODE [as 别名]
def add_sort_methods(sort_type):
if sort_type == 'sort_nothing':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_NONE)
if sort_type == 'sort_label':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
if sort_type == 'sort_label_ignore_folders':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_FOLDERS)
if sort_type == 'sort_episodes':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_EPISODE)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_VIDEO_TITLE)
示例3: menu_main
# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_EPISODE [as 别名]
def menu_main(id,category=''):
text = read_xml(id,1)
root = ElementTree.fromstring(text)
elemroot = root.iter('Gen')
j = 0
for elem in elemroot:
name = elem.attrib['name']
if re.search(ListOmit, name.encode('utf-8')): continue
id = elem.attrib['id']
se = elem.attrib['enableSearch']
if se=="1":
catType = elem.attrib['search'][:-1].encode('utf-8') #change unicode to str
else:
catType = ""
orderID = int(elem.attrib['orderid'][:5]) #xbmc cannot sort >10000
j += 1
li=xbmcgui.ListItem('[COLOR FF00FF00][ ' + name + ' ][/COLOR]')
li.setInfo( type="Video", infoLabels={"Title":name, "Episode":orderID})
u=sys.argv[0]+"?mode=gen&name="+urllib.quote_plus(name.encode('utf-8'))+"&id="+id+"&category="+urllib.quote_plus(catType)
xbmcplugin.addDirectoryItem(int(sys.argv[1]),u,li,True)
#添加一个“PPS搜索”
li = xbmcgui.ListItem('[COLOR FFFF00FF]PPS.TV 网络电视[/COLOR][COLOR FFFFFF00] (主页) [/COLOR][COLOR FF00FFFF]共计:'+str(j)+'[/COLOR]【[COLOR FF00FF00]点此输入搜索内容[/COLOR]】')
li.setInfo(type="Video", infoLabels={"Title":name, "Episode":1})
u=sys.argv[0]+"?mode=search&name="+urllib.quote_plus('PPS搜索')
xbmcplugin.addDirectoryItem(int(sys.argv[1]),u,li,True)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_EPISODE)
##################################################################################
# 次目录
##################################################################################