ricerca globale: più veloce ad aprire i risultati

This commit is contained in:
marco
2019-11-24 20:50:52 +01:00
parent 0c2a49af89
commit 925e1d256f
+10 -8
View File
@@ -400,16 +400,17 @@ def show_result(item):
if item.__dict__.has_key('tecleado'):
tecleado = item.__dict__.pop('tecleado')
try:
channel = __import__('channels.%s' % item.channel, fromlist=["channels.%s" % item.channel])
except:
import traceback
logger.error(traceback.format_exc())
return []
# try:
# channel = __import__('channels.%s' % item.channel, fromlist=["channels.%s" % item.channel])
# except:
# import traceback
# logger.error(traceback.format_exc())
# return []
if tecleado:
# Mostrar resultados: agrupados por canales
return channel.search(item, tecleado)
return [Item().fromurl(i) for i in item.itemlist]
# return channel.search(item, tecleado)
else:
# Mostrar resultados: todos juntos
if item.infoPlus: #Si viene de una ventana de InfoPlus, hay que salir de esta forma...
@@ -619,7 +620,8 @@ def do_search(item, categories=None):
if type(i) == Item:
plot += i.title + '\n'
itemlist.append(Item(title=title, channel="search", action="show_result", url=element["item"].url,
extra=element["item"].extra, folder=True, adult=element["adult"], plot=plot, thumbnail=element["thumbnail"],
extra=element["item"].extra, folder=True, adult=element["adult"], plot=plot,
thumbnail=element["thumbnail"], itemlist=[e.tourl() for e in element["itemlist"]],
from_action="search", from_channel=element["item"].channel, tecleado=tecleado))
# todos los resultados juntos, en la misma lista
else: