Possibile Fix Ricerca Globale
This commit is contained in:
@@ -37,6 +37,7 @@ def start():
|
|||||||
updater.showSavedChangelog()
|
updater.showSavedChangelog()
|
||||||
|
|
||||||
def run(item=None):
|
def run(item=None):
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
logger.debug()
|
logger.debug()
|
||||||
if not item:
|
if not item:
|
||||||
# Extract item from sys.argv
|
# Extract item from sys.argv
|
||||||
@@ -92,9 +93,12 @@ 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 config.get_setting('new_search') and item.channel == "search" and item.action == 'new_search':
|
if item.channel =='globalsearch' or (config.get_setting('new_search') and item.channel == "search" and item.action == 'new_search'):
|
||||||
item.channel = 'globalsearch'
|
|
||||||
item.action = 'Search'
|
item.action = 'Search'
|
||||||
|
item.contextual = True
|
||||||
|
item.mode = 'all'
|
||||||
|
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 == "":
|
||||||
|
|||||||
@@ -24,11 +24,9 @@ def set_workers():
|
|||||||
return workers
|
return workers
|
||||||
|
|
||||||
def Search(*args):
|
def Search(*args):
|
||||||
xbmc.executebuiltin('Dialog.Close(all)')
|
|
||||||
w = SearchWindow('GlobalSearch.xml', config.get_runtime_path())
|
w = SearchWindow('GlobalSearch.xml', config.get_runtime_path())
|
||||||
w.start(*args)
|
w.start(*args)
|
||||||
del w
|
del w
|
||||||
xbmc.sleep(1000)
|
|
||||||
|
|
||||||
# Actions
|
# Actions
|
||||||
LEFT = 1
|
LEFT = 1
|
||||||
@@ -65,7 +63,7 @@ QUALITYTAG = 505
|
|||||||
EPISODESLIST = 200
|
EPISODESLIST = 200
|
||||||
SERVERLIST = 300
|
SERVERLIST = 300
|
||||||
|
|
||||||
class SearchWindow(xbmcgui.WindowXML):
|
class SearchWindow(xbmcgui.WindowXMLDialog):
|
||||||
def start(self, item, moduleDict={}, searchActions=[]):
|
def start(self, item, moduleDict={}, searchActions=[]):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
self.exit = False
|
self.exit = False
|
||||||
@@ -659,8 +657,9 @@ class SearchWindow(xbmcgui.WindowXML):
|
|||||||
|
|
||||||
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'))
|
||||||
server.globalsearch = True
|
return play(self, server)
|
||||||
return run(server)
|
# server.globalsearch = True
|
||||||
|
# return run(server)
|
||||||
|
|
||||||
def Back(self):
|
def Back(self):
|
||||||
self.getControl(QUALITYTAG).setText('')
|
self.getControl(QUALITYTAG).setText('')
|
||||||
@@ -689,7 +688,6 @@ class SearchWindow(xbmcgui.WindowXML):
|
|||||||
self.thread.join()
|
self.thread.join()
|
||||||
busy(False)
|
busy(False)
|
||||||
self.close()
|
self.close()
|
||||||
del self
|
|
||||||
|
|
||||||
def context(self):
|
def context(self):
|
||||||
focus = self.getFocusId()
|
focus = self.getFocusId()
|
||||||
@@ -710,3 +708,14 @@ class SearchWindow(xbmcgui.WindowXML):
|
|||||||
context_commands = [c[1].replace('Container.Refresh', 'RunPlugin').replace('Container.Update', 'RunPlugin') for c in commands]
|
context_commands = [c[1].replace('Container.Refresh', 'RunPlugin').replace('Container.Update', 'RunPlugin') for c in commands]
|
||||||
index = xbmcgui.Dialog().contextmenu(context)
|
index = xbmcgui.Dialog().contextmenu(context)
|
||||||
if index > 0: xbmc.executebuiltin(context_commands[index])
|
if index > 0: xbmc.executebuiltin(context_commands[index])
|
||||||
|
|
||||||
|
|
||||||
|
def play(self, server):
|
||||||
|
server.globalsearch = True
|
||||||
|
run(server)
|
||||||
|
while not platformtools.is_playing():
|
||||||
|
xbmc.sleep(500)
|
||||||
|
self.close()
|
||||||
|
while platformtools.is_playing():
|
||||||
|
xbmc.sleep(500)
|
||||||
|
self.doModal()
|
||||||
+12
-5
@@ -38,11 +38,18 @@ def_lang = info_language[config.get_setting("info_language", "videolibrary")]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
itemlist = [Item(channel=item.channel, title=config.get_localized_string(70276), action='new_search', mode='all', thumbnail=get_thumb("search.png")),
|
if config.get_setting('new_search'):
|
||||||
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30122), action='new_search', mode='movie', thumbnail=get_thumb("search_movie.png")),
|
itemlist = [Item(channel='globalsearch', title=config.get_localized_string(70276), action='Search', mode='all', thumbnail=get_thumb("search.png"), folder=False),
|
||||||
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30123), action='new_search', mode='tvshow', thumbnail=get_thumb("search_tvshow.png")),
|
Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(30122), action='Search', mode='movie', thumbnail=get_thumb("search_movie.png"),folder=False),
|
||||||
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(70314), action='new_search', page=1, mode='person', thumbnail=get_thumb("search_star.png")),
|
Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(30123), action='Search', mode='tvshow', thumbnail=get_thumb("search_tvshow.png"), folder=False),
|
||||||
Item(channel=item.channel, title=config.get_localized_string(59995), action='saved_search', thumbnail=get_thumb('search.png')),
|
Item(channel='globalsearch', title=config.get_localized_string(70741) % config.get_localized_string(70314), action='Search', page=1, mode='person', thumbnail=get_thumb("search_star.png"), folder=False)]
|
||||||
|
else:
|
||||||
|
itemlist = [Item(channel=item.channel, title=config.get_localized_string(70276), action='new_search', mode='all', thumbnail=get_thumb("search.png")),
|
||||||
|
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30122), action='new_search', mode='movie', thumbnail=get_thumb("search_movie.png")),
|
||||||
|
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(30123), action='new_search', mode='tvshow', thumbnail=get_thumb("search_tvshow.png")),
|
||||||
|
Item(channel=item.channel, title=config.get_localized_string(70741) % config.get_localized_string(70314), action='new_search', page=1, mode='person', thumbnail=get_thumb("search_star.png"))]
|
||||||
|
|
||||||
|
itemlist += [Item(channel=item.channel, title=config.get_localized_string(59995), action='saved_search', thumbnail=get_thumb('search.png')),
|
||||||
Item(channel=item.channel, title=config.get_localized_string(60420), action='sub_menu', thumbnail=get_thumb('search.png')),
|
Item(channel=item.channel, title=config.get_localized_string(60420), action='sub_menu', thumbnail=get_thumb('search.png')),
|
||||||
Item(channel="tvmoviedb", title=config.get_localized_string(70274), action="mainlist", thumbnail=get_thumb("search.png")),
|
Item(channel="tvmoviedb", title=config.get_localized_string(70274), action="mainlist", thumbnail=get_thumb("search.png")),
|
||||||
Item(channel=item.channel, title=typo(config.get_localized_string(59994), 'color kod bold'), action='setting_channel_new', thumbnail=get_thumb('setting_0.png')),
|
Item(channel=item.channel, title=typo(config.get_localized_string(59994), 'color kod bold'), action='setting_channel_new', thumbnail=get_thumb('setting_0.png')),
|
||||||
|
|||||||
Reference in New Issue
Block a user