Python xbmcplugin.SORT_METHOD_EPISODE Examples

The following are 3 code examples of xbmcplugin.SORT_METHOD_EPISODE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcplugin , or try the search function .
Example #1
Source File: container.py    From plugin.video.themoviedb.helper with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #2
Source File: directory_utils.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
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) 
Example #3
Source File: default.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
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)

##################################################################################
# 次目录
##################################################################################