From cb16b0d91841ad4783a40f2705384b4e849d2ac1 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Mon, 26 Dec 2016 22:52:47 +0300 Subject: [PATCH] search fix --- Content.py | 7 ++++--- Core.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Content.py b/Content.py index 1df2910..0e57fc5 100644 --- a/Content.py +++ b/Content.py @@ -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 diff --git a/Core.py b/Core.py index 3ffd589..445e548 100644 --- a/Core.py +++ b/Core.py @@ -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'):