ContentLoader.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:plugin.video.telekom-sport 作者: asciidisco 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号