本文整理匯總了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)
示例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)
示例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)
示例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)
示例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)
示例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