search fix

pull/15/head
DiMartinoXBMC 2016-12-26 22:52:47 +03:00
parent f45dd93a57
commit cb16b0d918
2 changed files with 18 additions and 3 deletions

View File

@ -132,7 +132,8 @@ class Content:
else:
get = self.category_dict[category][subcategory]
if category == 'search': get = (get[0], get[1] % urllib.quote_plus(subcategory.encode('utf-8')))
if category == 'search' and subcategory != True:
get = (get[0], get[1] % urllib.quote_plus(subcategory.encode('utf-8')))
property = self.get_property(category, subcategory)
@ -173,8 +174,8 @@ class Content:
except:
pass
if has_property:
if category == 'search': property['page'] = property['page'] % urllib.quote_plus(
subcategory.encode('utf-8'))
if category == 'search' and subcategory != True:
property['page'] = property['page'] % urllib.quote_plus(subcategory.encode('utf-8'))
return property

14
Core.py
View File

@ -727,6 +727,19 @@ class Core:
else:
if provider:
self.Content = self.contenterObject[provider]
if category == 'search' and provider and subcategory == True:
keyboard = xbmc.Keyboard('', self.localize('Search Phrase') + ':')
keyboard.doModal()
query = keyboard.getText()
if not query:
return
elif keyboard.isConfirmed():
subcategory = query
if subcategory:
apps['subcategory'] = subcategory
else:
return
if not self.Content.isTracker():
self.draw(apps, mode='content')
else:
@ -742,6 +755,7 @@ class Core:
page = apps.get('page') if apps.get('page') else 1
sort = apps.get('sort') if apps.get('sort') else 0
apps_property={'page':page, 'sort':sort}
log('draw: '+str((category, subcategory)))
property = self.Content.get_property(category, subcategory)
contentList = self.Content.get_contentList(category, subcategory, apps_property)
if property and property.get('page'):