def list_channels():
"""show channels on the kodi list."""
playlist = utility.read_list(playlists_file)
if not playlist:
ok(ADDON.getLocalizedString(11005), ADDON.getLocalizedString(11006))
return None
for channel in playlist:
url = channel['url'].encode('utf-8')
name = channel['display_name'].encode('utf-8')
action_url = build_url({'mode': 'play', 'url': url, 'name': name})
item = xbmcgui.ListItem(name, iconImage='DefaultVideo.png')
item.setInfo(type='Video', infoLabels={'Title': name})
xbmcplugin.addDirectoryItem(handle=HANDLE, url=action_url, listitem=item)
xbmcplugin.endOfDirectory(HANDLE, cacheToDisc=False)
评论列表
文章目录