def _user_search(self):
page = int(self.root.params['page'])
q = self.root.params['q']
if q == 'none':
s_win = xbmc.Keyboard()
s_win.setHeading(self.root.gui._string(400515))
s_win.setHiddenInput(False)
s_win.doModal()
if s_win.isConfirmed():
q = s_win.getText()
else:
self.notify(self._string(400525), '')
return
else:
q = pickle.loads(binascii.unhexlify(q))
history = get_search_history(_FILE_USER_SEARCH_HISTORY)
try:
del history[history.index(q)]
except ValueError:
pass
history = [q] + history
put_search_history(history, _FILE_USER_SEARCH_HISTORY)
query_hex = binascii.hexlify(pickle.dumps(q, -1))
kwargs = {
'page': page,
'q': q
}
u = User(self.root.u.id, self.root.conn)
search_res = u.user_search(**kwargs)
if page < search_res['pages']:
params = {'do': _DO_VIDEO_SEARCH, 'q': query_hex, 'page': page + 1}
self.root.add_folder(self.root.gui._string(400602), params)
self.__create_user_list_(search_res)
if page < search_res['pages']:
params = {'do': _DO_VIDEO_SEARCH, 'q': query_hex, 'page': page + 1}
self.root.add_folder(self.root.gui._string(400602), params)
xbmcplugin.endOfDirectory(_addon_id)
评论列表
文章目录