From 887515db610f14c1210267865d1bcce7e1856457 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Tue, 15 Dec 2020 20:15:33 +0100 Subject: [PATCH] Ricerca Globale Fix Autoplay --- platformcode/launcher.py | 6 ------ specials/globalsearch.py | 14 ++++++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index c8893f1b..0dc5110f 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -93,12 +93,6 @@ def run(item=None): if not config.get_setting('tmdb_active'): config.set_setting('tmdb_active', True) - if item.channel =='globalsearch' or (config.get_setting('new_search') and item.channel == "search" and item.action == 'new_search'): - item.action = 'Search' - item.contextual = True - from specials.globalsearch import Search - return Search(item) - # If item has no action, stops here if item.action == "": logger.debug("Item without action") diff --git a/specials/globalsearch.py b/specials/globalsearch.py index 2eb14059..c416552a 100644 --- a/specials/globalsearch.py +++ b/specials/globalsearch.py @@ -478,6 +478,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog): self.SERVERS.setVisible(True) def onAction(self, action): + global close_action action = action.getId() focus = self.getFocusId() if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]: @@ -516,6 +517,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog): elif action in [EXIT]: self.Close() + close_action = True def onClick(self, control_id): global close_action @@ -607,6 +609,9 @@ class SearchWindow(xbmcgui.WindowXMLDialog): self.itemsResult = [] if self.itemsResult and self.itemsResult[0].action in ['play', '']: + if config.get_setting('autoplay'): + busy(False) + self.play() if config.get_setting('checklinks') and not config.get_setting('autoplay'): self.itemsResult = servertools.check_list_links(self.itemsResult, config.get_setting('checklinks_number')) @@ -735,12 +740,13 @@ class SearchWindow(xbmcgui.WindowXMLDialog): if index > 0: xbmc.executebuiltin(context_commands[index]) - def play(self, server): - server.globalsearch = True - run(server) + def play(self, server=None): + if server: + server.globalsearch = True + run(server) while not platformtools.is_playing(): xbmc.sleep(500) self.close() - while platformtools.is_playing(): + while xbmcgui.getCurrentWindowId() in [12005, 12006]: xbmc.sleep(500) self.doModal()