Ricerca Globale Fix Autoplay
This commit is contained in:
@@ -93,12 +93,6 @@ def run(item=None):
|
|||||||
if not config.get_setting('tmdb_active'):
|
if not config.get_setting('tmdb_active'):
|
||||||
config.set_setting('tmdb_active', True)
|
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 has no action, stops here
|
||||||
if item.action == "":
|
if item.action == "":
|
||||||
logger.debug("Item without action")
|
logger.debug("Item without action")
|
||||||
|
|||||||
@@ -478,6 +478,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.SERVERS.setVisible(True)
|
self.SERVERS.setVisible(True)
|
||||||
|
|
||||||
def onAction(self, action):
|
def onAction(self, action):
|
||||||
|
global close_action
|
||||||
action = action.getId()
|
action = action.getId()
|
||||||
focus = self.getFocusId()
|
focus = self.getFocusId()
|
||||||
if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]:
|
if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]:
|
||||||
@@ -516,6 +517,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
elif action in [EXIT]:
|
elif action in [EXIT]:
|
||||||
self.Close()
|
self.Close()
|
||||||
|
close_action = True
|
||||||
|
|
||||||
def onClick(self, control_id):
|
def onClick(self, control_id):
|
||||||
global close_action
|
global close_action
|
||||||
@@ -607,6 +609,9 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.itemsResult = []
|
self.itemsResult = []
|
||||||
|
|
||||||
if self.itemsResult and self.itemsResult[0].action in ['play', '']:
|
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'):
|
if config.get_setting('checklinks') and not config.get_setting('autoplay'):
|
||||||
self.itemsResult = servertools.check_list_links(self.itemsResult, config.get_setting('checklinks_number'))
|
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])
|
if index > 0: xbmc.executebuiltin(context_commands[index])
|
||||||
|
|
||||||
|
|
||||||
def play(self, server):
|
def play(self, server=None):
|
||||||
server.globalsearch = True
|
if server:
|
||||||
run(server)
|
server.globalsearch = True
|
||||||
|
run(server)
|
||||||
while not platformtools.is_playing():
|
while not platformtools.is_playing():
|
||||||
xbmc.sleep(500)
|
xbmc.sleep(500)
|
||||||
self.close()
|
self.close()
|
||||||
while platformtools.is_playing():
|
while xbmcgui.getCurrentWindowId() in [12005, 12006]:
|
||||||
xbmc.sleep(500)
|
xbmc.sleep(500)
|
||||||
self.doModal()
|
self.doModal()
|
||||||
|
|||||||
Reference in New Issue
Block a user