Fix nuova ricerca globale

This commit is contained in:
Alhaziel01
2020-11-23 12:33:21 +01:00
parent 096f8dbfe1
commit 9df29b6113
4 changed files with 126 additions and 81 deletions
+17 -7
View File
@@ -55,21 +55,31 @@ def find_and_set_infoLabels(item):
import traceback
logger.error(traceback.format_exc())
while scraper or not item.exit:
while scraper:
# We call the find_and_set_infoLabels function of the selected scraper
scraper_result = scraper.find_and_set_infoLabels(item)
if item.exit: return False
# Check if there is a 'code'
elif scraper_result and item.infoLabels['code']:
if scraper_result and item.infoLabels['code']:
# correct code
logger.info("Identifier found: %s " % item.infoLabels['code'])
logger.info("Identificador encontrado: %s" % item.infoLabels['code'])
scraper.completar_codigos(item)
return True
elif scraper_result:
# Content found but no 'code'
msg = config.get_localized_string(60227) % title
else:
# Content not found
logger.info(logger.info("Identifier not found for: %s " % title))
item = platformtools.dialog_info(item, scraper_actual)
if item.exit: return False
msg = config.get_localized_string(60228) % title
logger.info(msg)
# Show box with other options:
item = platformtools.dialog_info(item, scraper_actual)
if item.exit:
logger.debug("You have clicked 'cancel' in the window '%s'" % msg)
return False
logger.error("Error importing the scraper module %s" % scraper_actual)
def cuadro_completar(item):
+10 -10
View File
@@ -1006,17 +1006,17 @@ def add_movie(item):
item = generictools.update_title(item) # We call the method that updates the title with tmdb.find_and_set_infoLabels
#if item.tmdb_stat:
# del item.tmdb_stat # We clean the status so that it is not recorded in the Video Library
if item:
new_item = item.clone(action="findvideos")
insertados, sobreescritos, fallidos, path = save_movie(new_item)
# if item:
new_item = item.clone(action="findvideos")
insertados, sobreescritos, fallidos, path = save_movie(new_item)
if fallidos == 0:
platformtools.dialog_ok(config.get_localized_string(30131),
config.get_localized_string(30135) % new_item.contentTitle) # 'has been added to the video library'
else:
filetools.rmdirtree(path)
platformtools.dialog_ok(config.get_localized_string(30131),
config.get_localized_string(60066) % new_item.contentTitle) # "ERROR, the movie has NOT been added to the video library")
if fallidos == 0:
platformtools.dialog_ok(config.get_localized_string(30131),
config.get_localized_string(30135) % new_item.contentTitle) # 'has been added to the video library'
else:
filetools.rmdirtree(path)
platformtools.dialog_ok(config.get_localized_string(30131),
config.get_localized_string(60066) % new_item.contentTitle) # "ERROR, the movie has NOT been added to the video library")
def add_tvshow(item, channel=None):