Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Update list.py #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions source/plugin.video.filmix.net.dev/core/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,35 @@ def handle(self):
if(len(history) >= req_count):
SQL.set('DELETE FROM search WHERE `id` = (SELECT MIN(id) FROM search)')

#page_url = "search/index/index/usersearch/"+params['usersearch']
page_url = "/engine/ajax/sphinx_search.php?story=%s&search_start=%s" % (params['usersearch'], page+1)
md5 = hashlib.md5()
#md5.update(page_url+'/page/'+str(page))
md5.update(params['usersearch'].encode('utf8')+'?v='+xbmcup.app.addon['version'])
response = CACHE(str(md5.hexdigest()), self.get_movies, page_url, page, '', False, usersearch)

post_data={'search_word' : params['vsearch']}
post_result = self.ajax(SITE_URL+'/api/search/suggest',post_data)
json_result = json.loads(post_result)

response = {'page': {}, 'data': []}
re_info = re.compile('<.*?>')
for m in json_result['message']:
year_info = ''
if(m['year'] != ''):
year_info = m['year']+', '
year_info += re.sub(re_info, '', m['categories'])

response['data'].append({
'name': m['title'].strip(),
'img': m['poster'].replace('/w40/','/w220/'),
'url': m['link'],
'not_movie': False,
'year': '[COLOR white]['+year_info+'][/COLOR]',
'quality': '',
'id': m['id']
})

if(is_united_search == 0):
self.item(u'[COLOR yellow]'+xbmcup.app.lang[30108]+'[/COLOR]', self.link('search'), folder=True, cover=cover.search)
self.item('[COLOR blue]['+xbmcup.app.lang[30109]+': '+vsearch+'][/COLOR]',
self.link('null'), folder=False, cover=cover.info)

if(is_united_search==0 and response['page']['pagenum'] > 1):
params['page'] = page-1
self.item('[COLOR green]'+xbmcup.app.lang[30106]+'[/COLOR]', self.replace('search', params), cover=cover.prev, folder=True)
params['page'] = page+1

self.add_movies(response)

params['page'] = page+1
if(is_united_search == 0):
if(response['page']['maxpage'] >= response['page']['pagenum']+1):
self.item(u'[COLOR green]'+xbmcup.app.lang[30107]+'[/COLOR]', self.replace('search', params), cover=cover.next, folder=True)


class BookmarkList(AbstactList):

Expand Down