From 775b8745f8648ac9a6e07772b861459ea3094ea4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Tue, 5 Oct 2021 09:36:45 +0200 Subject: [PATCH] Probabile Fix Blocco Ricerca Globale --- specials/globalsearch.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/specials/globalsearch.py b/specials/globalsearch.py index fce4723b..40bc452c 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -332,8 +332,22 @@ class SearchWindow(xbmcgui.WindowXML): try: with futures.ThreadPoolExecutor(max_workers=set_workers()) as executor: for searchAction in self.getActions(): - if self.exit: return + if self.exit: break self.search_threads.append(executor.submit(self.get_channel_results, searchAction)) + for res in futures.as_completed(self.search_threads): + if self.exit: break + if res.result(): + channel, valid, results = res.result() + self.update(channel, valid, results) + + # if results: + # name = results[0].channel + # if name not in results: + # self.channels[name] = [] + # self.channels[name].extend(results) + + # if valid or results: + # self.update() except: import traceback logger.error(traceback.format_exc()) @@ -384,10 +398,11 @@ class SearchWindow(xbmcgui.WindowXML): if self.exit: return - update_lock.acquire() + # update_lock.acquire() self.count += 1 - self.update(channel, valid, other if other else results) - update_lock.release() + return channel, valid, other if other else results + # self.update(channel, valid, other if other else results) + # update_lock.release() def makeItem(self, url): item = Item().fromurl(url)