Ulteriori Impostazioni per ricerca Globale
This commit is contained in:
@@ -270,9 +270,10 @@ def run(item=None):
|
|||||||
# Special action for searching, first asks for the words then call the "search" function
|
# Special action for searching, first asks for the words then call the "search" function
|
||||||
elif item.action == "search":
|
elif item.action == "search":
|
||||||
logger.info("item.action=%s" % item.action.upper())
|
logger.info("item.action=%s" % item.action.upper())
|
||||||
|
if channeltools.get_channel_setting('last_search', 'search'):
|
||||||
last_search = channeltools.get_channel_setting('Last_searched', 'search', '')
|
last_search = channeltools.get_channel_setting('Last_searched', 'search', '')
|
||||||
|
else:
|
||||||
|
last_search = ''
|
||||||
tecleado = platformtools.dialog_input(last_search)
|
tecleado = platformtools.dialog_input(last_search)
|
||||||
if tecleado is not None:
|
if tecleado is not None:
|
||||||
channeltools.set_channel_setting('Last_searched', tecleado, 'search')
|
channeltools.set_channel_setting('Last_searched', tecleado, 'search')
|
||||||
|
|||||||
@@ -29,6 +29,15 @@
|
|||||||
"40"
|
"40"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "result_mode",
|
||||||
|
"type": "list",
|
||||||
|
"label": "@60657",
|
||||||
|
"default": 0,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": ["@60675","@60676"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "thread_number",
|
"id": "thread_number",
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
|||||||
+24
-16
@@ -244,7 +244,12 @@ def channel_search(item):
|
|||||||
if it in valid:
|
if it in valid:
|
||||||
continue
|
continue
|
||||||
if mode == 'all' or (it.contentType and mode == it.contentType):
|
if mode == 'all' or (it.contentType and mode == it.contentType):
|
||||||
grouped.append(it)
|
if config.get_setting('result_mode', 'search') != 0:
|
||||||
|
if config.get_localized_string(30992) not in it.title:
|
||||||
|
it.title += typo(ch_name,'_ [] color kod bold')
|
||||||
|
results.append(it)
|
||||||
|
else:
|
||||||
|
grouped.append(it)
|
||||||
elif (mode == 'movie' and it.contentTitle) or (mode == 'tvshow' and (it.contentSerieName or it.show)):
|
elif (mode == 'movie' and it.contentTitle) or (mode == 'tvshow' and (it.contentSerieName or it.show)):
|
||||||
grouped.append(it)
|
grouped.append(it)
|
||||||
else:
|
else:
|
||||||
@@ -253,28 +258,31 @@ def channel_search(item):
|
|||||||
if not grouped:
|
if not grouped:
|
||||||
continue
|
continue
|
||||||
# to_temp[key] = grouped
|
# to_temp[key] = grouped
|
||||||
|
if config.get_setting('result_mode', 'search') == 0:
|
||||||
|
if not config.get_setting('unify'):
|
||||||
|
title = typo(ch_name,'bold') + typo(str(len(grouped)), '_ [] color kod bold')
|
||||||
|
else:
|
||||||
|
title = typo('%s %s' % (len(grouped), config.get_localized_string(70695)), 'bold')
|
||||||
|
res_count += len(grouped)
|
||||||
|
plot=''
|
||||||
|
|
||||||
if not config.get_setting('unify'):
|
for it in grouped:
|
||||||
title = typo(ch_name,'bold') + typo(str(len(grouped)), '_ [] color kod bold')
|
plot += it.title +'\n'
|
||||||
else:
|
ch_thumb = channeltools.get_channel_parameters(key)['thumbnail']
|
||||||
title = typo('%s %s' % (len(grouped), config.get_localized_string(70695)), 'bold')
|
results.append(Item(channel='search', title=title,
|
||||||
res_count += len(grouped)
|
action='get_from_temp', thumbnail=ch_thumb, itemlist=[ris.tourl() for ris in grouped], plot=plot, page=1))
|
||||||
plot=''
|
results = sorted(results, key=lambda it: it.from_channel)
|
||||||
for it in grouped:
|
|
||||||
plot += it.title +'\n'
|
|
||||||
ch_thumb = channeltools.get_channel_parameters(key)['thumbnail']
|
|
||||||
results.append(Item(channel='search', title=title,
|
|
||||||
action='get_from_temp', thumbnail=ch_thumb, itemlist=[ris.tourl() for ris in grouped], plot=plot, page=1))
|
|
||||||
|
|
||||||
results = sorted(results, key=lambda it: it.from_channel)
|
|
||||||
|
|
||||||
# send_to_temp(to_temp)
|
# send_to_temp(to_temp)
|
||||||
config.set_setting('tmdb_active', True)
|
config.set_setting('tmdb_active', True)
|
||||||
if item.mode == 'all':
|
if item.mode == 'all':
|
||||||
|
if config.get_setting('result_mode', 'search') != 0:
|
||||||
|
res_count = len(results)
|
||||||
|
results = sorted(results, key=lambda it: it.title)
|
||||||
results_statistic = config.get_localized_string(59972) % (item.title, res_count, time.time() - start)
|
results_statistic = config.get_localized_string(59972) % (item.title, res_count, time.time() - start)
|
||||||
results.insert(0, Item(title = typo(results_statistic,'color kod bold')))
|
results.insert(0, Item(title = typo(results_statistic,'color kod bold')))
|
||||||
# logger.debug(results_statistic)
|
# logger.debug(results_statistic)
|
||||||
|
|
||||||
return valid + results
|
return valid + results
|
||||||
|
|
||||||
|
|
||||||
@@ -284,7 +292,7 @@ def get_channel_results(ch, item, session):
|
|||||||
|
|
||||||
ch_params = channeltools.get_channel_parameters(ch)
|
ch_params = channeltools.get_channel_parameters(ch)
|
||||||
|
|
||||||
exec "from channels import " + ch_params["channel"] + " as module"
|
exec("from channels import " + ch_params["channel"] + " as module")
|
||||||
|
|
||||||
mainlist = module.mainlist(Item(channel=ch_params["channel"]))
|
mainlist = module.mainlist(Item(channel=ch_params["channel"]))
|
||||||
search_action = [elem for elem in mainlist if elem.action == "search" and (item.mode == 'all' or elem.contentType == item.mode)]
|
search_action = [elem for elem in mainlist if elem.action == "search" and (item.mode == 'all' or elem.contentType == item.mode)]
|
||||||
@@ -735,5 +743,5 @@ def get_saved_searches():
|
|||||||
saved_searches_list = []
|
saved_searches_list = []
|
||||||
else:
|
else:
|
||||||
saved_searches_list = list(current_saved_searches_list)
|
saved_searches_list = list(current_saved_searches_list)
|
||||||
|
|
||||||
return saved_searches_list
|
return saved_searches_list
|
||||||
Reference in New Issue
Block a user