default.py 文件源码

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

项目:kodi-vk.inpos.ru 作者: inpos 项目源码 文件源码
def _main_video_search(self):
        page = int(self.root.params['page'])
        self.root.add_folder(self.root.gui._string(400516), {'do': _DO_VIDEO_SEARCH, 'q':'none', 'page': 1})
        history = get_search_history(_FILE_VIDEO_SEARCH_HISTORY)
        count = len(history)
        pages = int(ceil(count / float(_SETTINGS_PAGE_ITEMS)))
        if page < pages:
            params = {'do': _DO_MAIN_VIDEO_SEARCH, 'page': page + 1}
            self.root.add_folder(self.root.gui._string(400602), params)
        h_start = _SETTINGS_PAGE_ITEMS * (page -1)
        h_end = h_start + _SETTINGS_PAGE_ITEMS
        history = history[h_start:h_end]
        for h in history:
            query_hex = binascii.hexlify(pickle.dumps(h, -1))
            list_item = xbmcgui.ListItem(h)
            params = {'do': _DO_VIDEO_SEARCH, 'q': query_hex, 'page': 1}
            url = self.root.url(**params)
            xbmcplugin.addDirectoryItem(_addon_id, url, list_item, isFolder = True)
        if page < pages:
            params = {'do': _DO_MAIN_VIDEO_SEARCH, 'page': page + 1}
            self.root.add_folder(self.root.gui._string(400602), params)
        xbmcplugin.endOfDirectory(_addon_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号