本文整理匯總了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)
##################################################################################
# 次目錄
##################################################################################