def show_date_list(self, _for):
"""
Creates the KODI list items for a list of dates with contents
based on the current date & syndication.
:param _for: Chosen sport
:type _for: string
"""
self.utils.log('Main menu')
plugin_handle = self.plugin_handle
addon_data = self.utils.get_addon_data()
epg = self.get_epg(_for)
for _date in epg.keys():
title = ''
items = epg.get(_date)
for item in items:
title = title + \
str(' '.join(item.get('title').replace('Uhr', '').split(
' ')[:-2]).encode('utf-8')) + '\n\n'
url = self.utils.build_url({'date': date, 'for': _for})
list_item = xbmcgui.ListItem(label=_date)
list_item.setProperty('fanart_image', addon_data.get('fanart'))
list_item.setInfo('video', {
'date': date,
'title': title,
'plot': title,
})
xbmcplugin.addDirectoryItem(
handle=plugin_handle,
url=url,
listitem=list_item,
isFolder=True)
xbmcplugin.addSortMethod(
handle=plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_DATE)
xbmcplugin.endOfDirectory(plugin_handle)
ContentLoader.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录