本文整理汇总了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