def category(group):
promoGroup = {'rising': 'RISING', 'discovery': 'DISCOVERY', 'featured': 'NEWS'}.get(group, None)
items = session.get_category_items(group)
totalCount = 0
for item in items:
totalCount += len(item.content_types)
if totalCount == 1:
# Show Single content directly (Movies and TV Shows)
for item in items:
content_types = item.content_types
for content_type in content_types:
category_content(group, item.path, content_type, offset=0)
return
xbmcplugin.setContent(plugin.handle, 'files')
if promoGroup and totalCount > 10:
# Add Promotions as Folder on the Top if more than 10 Promotions available
add_directory(_T(30120), plugin.url_for(featured, group=promoGroup))
add_directory('Master %s (MQA)' % _T(30107), plugin.url_for(master_albums, offset=0))
add_directory('Master %s (MQA)' % _T(30108), plugin.url_for(master_playlists, offset=0))
# Add Category Items as Folders
add_items(items, content=None, end=not(promoGroup and totalCount <= 10))
if promoGroup and totalCount <= 10:
# Show up to 10 Promotions as single Items
promoItems = session.get_featured(promoGroup, types=['ALBUM', 'PLAYLIST', 'VIDEO'])
if promoItems:
add_items(promoItems, end=True)
评论列表
文章目录