當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcplugin.SORT_METHOD_VIDEO_YEAR屬性代碼示例

本文整理匯總了Python中xbmcplugin.SORT_METHOD_VIDEO_YEAR屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcplugin.SORT_METHOD_VIDEO_YEAR屬性的具體用法?Python xbmcplugin.SORT_METHOD_VIDEO_YEAR怎麽用?Python xbmcplugin.SORT_METHOD_VIDEO_YEAR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在xbmcplugin的用法示例。


在下文中一共展示了xbmcplugin.SORT_METHOD_VIDEO_YEAR屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: browse_album

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def browse_album(self):
        xbmcplugin.setContent(self.addon_handle, "songs")
        album = self.sp.album(self.albumid, market=self.usercountry)
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', album["name"])
        tracks = self.get_album_tracks(album)
        if album.get("album_type") == "compilation":
            self.add_track_listitems(tracks, True)
        else:
            self.add_track_listitems(tracks)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TRACKNUM)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TITLE)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_ARTIST)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_songs:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs) 
開發者ID:kodi-community-addons,項目名稱:plugin.audio.spotify,代碼行數:20,代碼來源:plugin_content.py

示例2: kodi_draw_list

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def kodi_draw_list(parts, rows):
    for row in rows:
        xbmcplugin.addDirectoryItem(*row.item(parts))

    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_UNSORTED)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_VIDEO_RATING)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_DATE)
    xbmcplugin.setContent(h, 'files')
    xbmcplugin.endOfDirectory(h) 
開發者ID:Soap4me,項目名稱:Kodi,代碼行數:13,代碼來源:addon.py

示例3: artist_toptracks

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def artist_toptracks(self):
        xbmcplugin.setContent(self.addon_handle, "songs")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', self.addon.getLocalizedString(11011))
        tracks = self.sp.artist_top_tracks(self.artistid, country=self.usercountry)
        tracks = self.prepare_track_listitems(tracks=tracks["tracks"])
        self.add_track_listitems(tracks)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TRACKNUM)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TITLE)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_songs:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs) 
開發者ID:kodi-community-addons,項目名稱:plugin.audio.spotify,代碼行數:16,代碼來源:plugin_content.py

示例4: browse_artistalbums

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def browse_artistalbums(self):
        xbmcplugin.setContent(self.addon_handle, "albums")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', xbmc.getLocalizedString(132))
        artist = self.sp.artist(self.artistid)
        artistalbums = self.sp.artist_albums(
            self.artistid,
            limit=50,
            offset=0,
            market=self.usercountry,
            album_type='album,single,compilation')
        count = len(artistalbums['items'])
        albumids = []
        while artistalbums['total'] > count:
            artistalbums['items'] += self.sp.artist_albums(self.artistid,
                                                           limit=50,
                                                           offset=count,
                                                           market=self.usercountry,
                                                           album_type='album,single,compilation')['items']
            count += 50
        for album in artistalbums['items']:
            albumids.append(album["id"])
        albums = self.prepare_album_listitems(albumids)
        self.add_album_listitems(albums)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_ALBUM_IGNORE_THE)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_albums:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_albums) 
開發者ID:kodi-community-addons,項目名稱:plugin.audio.spotify,代碼行數:32,代碼來源:plugin_content.py

示例5: browse_savedalbums

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def browse_savedalbums(self):
        xbmcplugin.setContent(self.addon_handle, "albums")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', xbmc.getLocalizedString(132))
        albums = self.get_savedalbums()
        self.add_album_listitems(albums, True)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_ALBUM_IGNORE_THE)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        xbmcplugin.setContent(self.addon_handle, "albums")
        if self.defaultview_albums:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_albums) 
開發者ID:kodi-community-addons,項目名稱:plugin.audio.spotify,代碼行數:15,代碼來源:plugin_content.py

示例6: build_season_listing

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_VIDEO_YEAR [as 別名]
def build_season_listing(self, seasons_sorted, build_url, widget_display=False):
        """Builds the season list screen for a show

        Parameters
        ----------
        seasons_sorted : :obj:`list` of :obj:`dict` of :obj:`str`
            Sorted list of season entries

        build_url : :obj:`fn`
            Function to build the subsequent routes

        Returns
        -------
        bool
            List could be build
        """
        for season in seasons_sorted:
            li = xbmcgui.ListItem(label=season['text'])
            # add some art to the item
            li.setArt(self._generate_art_info(entry=season))
            # add list item info
            infos = self._generate_listitem_info(
                entry=season,
                li=li,
                base_info={'mediatype': 'season'})
            self._generate_context_menu_items(entry=season, li=li)
            params = {'action': 'episode_list', 'season_id': season['id']}
            if 'tvshowtitle' in infos:
                title = infos.get('tvshowtitle', '').encode('utf-8')
                params['tvshowtitle'] = base64.urlsafe_b64encode(title)
            url = build_url(params)
            xbmcplugin.addDirectoryItem(
                handle=self.plugin_handle,
                url=url,
                listitem=li,
                isFolder=True)

        xbmcplugin.addSortMethod(
            handle=self.plugin_handle,
            sortMethod=xbmcplugin.SORT_METHOD_NONE)
        xbmcplugin.addSortMethod(
            handle=self.plugin_handle,
            sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(
            handle=self.plugin_handle,
            sortMethod=xbmcplugin.SORT_METHOD_LABEL)
        xbmcplugin.addSortMethod(
            handle=self.plugin_handle,
            sortMethod=xbmcplugin.SORT_METHOD_LASTPLAYED)
        xbmcplugin.addSortMethod(
            handle=self.plugin_handle,
            sortMethod=xbmcplugin.SORT_METHOD_TITLE)
        xbmcplugin.setContent(
            handle=self.plugin_handle,
            content=CONTENT_SEASON)
        xbmcplugin.endOfDirectory(self.plugin_handle)
        if not widget_display:
            self.set_custom_view(VIEW_SEASON)
        return True 
開發者ID:asciidisco,項目名稱:plugin.video.netflix,代碼行數:61,代碼來源:KodiHelper.py


注:本文中的xbmcplugin.SORT_METHOD_VIDEO_YEAR屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。