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)
plugin_content.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录