FIx: Ricerca Globale con possibilità di switch fra ricerca e player
This commit is contained in:
+21
-11
@@ -40,6 +40,7 @@ BACKSPACE = 92
|
|||||||
SWIPEUP = 531
|
SWIPEUP = 531
|
||||||
CONTEXT = 117
|
CONTEXT = 117
|
||||||
MOUSEMOVE = 107
|
MOUSEMOVE = 107
|
||||||
|
FULLSCREEN = 18
|
||||||
|
|
||||||
# Container
|
# Container
|
||||||
SEARCH = 1
|
SEARCH = 1
|
||||||
@@ -481,6 +482,8 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
global close_action
|
global close_action
|
||||||
action = action.getId()
|
action = action.getId()
|
||||||
focus = self.getFocusId()
|
focus = self.getFocusId()
|
||||||
|
if action in [FULLSCREEN]:
|
||||||
|
self.playmonitor()
|
||||||
if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]:
|
if action in [CONTEXT] and focus in [RESULTS, EPISODESLIST, SERVERLIST]:
|
||||||
self.context()
|
self.context()
|
||||||
|
|
||||||
@@ -609,9 +612,6 @@ 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'))
|
||||||
@@ -664,6 +664,10 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
self.SERVERLIST.addItems(serverlist)
|
self.SERVERLIST.addItems(serverlist)
|
||||||
self.setFocusId(SERVERLIST)
|
self.setFocusId(SERVERLIST)
|
||||||
|
|
||||||
|
if config.get_setting('autoplay'):
|
||||||
|
busy(False)
|
||||||
|
self.playmonitor()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
episodes = self.itemsResult if self.itemsResult else []
|
episodes = self.itemsResult if self.itemsResult else []
|
||||||
self.itemsResult = []
|
self.itemsResult = []
|
||||||
@@ -687,7 +691,7 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
|
|
||||||
elif control_id in [SERVERLIST]:
|
elif control_id in [SERVERLIST]:
|
||||||
server = Item().fromurl(self.getControl(control_id).getSelectedItem().getProperty('item'))
|
server = Item().fromurl(self.getControl(control_id).getSelectedItem().getProperty('item'))
|
||||||
return self.play(server)
|
return self.playmonitor(server)
|
||||||
# server.globalsearch = True
|
# server.globalsearch = True
|
||||||
# return run(server)
|
# return run(server)
|
||||||
|
|
||||||
@@ -740,13 +744,19 @@ class SearchWindow(xbmcgui.WindowXMLDialog):
|
|||||||
if index > 0: xbmc.executebuiltin(context_commands[index])
|
if index > 0: xbmc.executebuiltin(context_commands[index])
|
||||||
|
|
||||||
|
|
||||||
def play(self, server=None):
|
def playmonitor(self, server=None):
|
||||||
if server:
|
if server:
|
||||||
server.globalsearch = True
|
server.globalsearch = True
|
||||||
run(server)
|
run(server)
|
||||||
while not platformtools.is_playing():
|
try:
|
||||||
xbmc.sleep(500)
|
while not xbmc.Player().getTime() > 0:
|
||||||
self.close()
|
xbmc.sleep(500)
|
||||||
while xbmcgui.getCurrentWindowId() in [12005, 12006]:
|
self.close()
|
||||||
xbmc.sleep(500)
|
while xbmcgui.getCurrentWindowId() in [12005, 12006]:
|
||||||
self.doModal()
|
xbmc.sleep(500)
|
||||||
|
if platformtools.is_playing():
|
||||||
|
xbmc.sleep(300)
|
||||||
|
xbmc.executebuiltin('Action(Fullscreen)')
|
||||||
|
self.doModal()
|
||||||
|
except:
|
||||||
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user