def add_album_listitems(self, albums, append_artist_to_label=False):
# process listing
for item in albums:
if append_artist_to_label:
label = "%s - %s" % (item["artist"], item['name'])
else:
label = item['name']
if KODI_VERSION > 17:
li = xbmcgui.ListItem(label, path=item['url'], offscreen=True)
else:
li = xbmcgui.ListItem(label, path=item['url'])
infolabels = {
"title": item['name'],
"genre": item["genre"],
"year": item["year"],
"album": item["name"],
"artist": item["artist"],
"rating": item["rating"]
}
li.setInfo(type="Music", infoLabels=infolabels)
li.setArt({"thumb": item['thumb']})
li.setProperty('do_not_analyze', 'true')
li.setProperty('IsPlayable', 'false')
li.addContextMenuItems(item["contextitems"], True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=item["url"], listitem=li, isFolder=True)
plugin_content.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录