From 47d2144b0a1df93fcda523505de9431f8c0affb7 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Sat, 7 Nov 2020 13:01:28 +0100 Subject: [PATCH] Aggiustamenti a TVDB e TMDB --- core/scraper.py | 3 ++- core/tmdb.py | 3 +-- core/tvdb.py | 2 +- platformcode/xbmc_info_window.py | 5 +++- resources/skins/Default/720p/InfoWindow.xml | 26 +++++++++++---------- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/core/scraper.py b/core/scraper.py index 818a3486..c59e19e1 100644 --- a/core/scraper.py +++ b/core/scraper.py @@ -57,8 +57,9 @@ def find_and_set_infoLabels(item): while scraper or not item.exit: # 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' - if scraper_result and item.infoLabels['code']: + elif scraper_result and item.infoLabels['code']: # correct code logger.info("Identifier found: %s " % item.infoLabels['code']) scraper.completar_codigos(item) diff --git a/core/tmdb.py b/core/tmdb.py index b31a6e28..c0f0e1a0 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -524,13 +524,12 @@ def find_and_set_infoLabels(item): otmdb_global = Tmdb(id_Tmdb=item.infoLabels['tmdb_id'], tipo=tipo_busqueda, idioma_busqueda=def_lang) results = otmdb_global.get_list_resultados() - if len(results) > 1: from platformcode import platformtools tmdb_result = platformtools.show_video_info(results, item=item, caption= tipo_contenido % title) if not tmdb_result: res = platformtools.dialog_info(item, 'tmdb') - if res: return find_and_set_infoLabels(res) + if not res.exit: return find_and_set_infoLabels(res) elif len(results) > 0: tmdb_result = results[0] diff --git a/core/tvdb.py b/core/tvdb.py index cb435137..79f28d4b 100644 --- a/core/tvdb.py +++ b/core/tvdb.py @@ -116,7 +116,7 @@ def find_and_set_infoLabels(item): tvdb_result = platformtools.show_video_info(results, item=item, scraper=Tvdb, caption=config.get_localized_string(60298) % title) if not tvdb_result: res = platformtools.dialog_info(item, 'tvdb') - if res: return find_and_set_infoLabels(res) + if not res.exit: return find_and_set_infoLabels(res) elif len(results) > 0: tvdb_result = results[0] diff --git a/platformcode/xbmc_info_window.py b/platformcode/xbmc_info_window.py index 968e9ab1..6f3a994e 100644 --- a/platformcode/xbmc_info_window.py +++ b/platformcode/xbmc_info_window.py @@ -13,6 +13,7 @@ else: BACKGROUND = 30000 LOADING = 30001 SELECT = 30002 +CLOSE = 30003 EXIT = 10 BACKSPACE = 92 @@ -64,7 +65,9 @@ class InfoWindow(xbmcgui.WindowXMLDialog): def onClick(self, control_id): if control_id == SELECT: self.response = self.results[self.getControl(SELECT).getSelectedPosition()] - self.close() + self.close() + elif control_id == CLOSE: + self.close() def onAction(self, action): if self.getFocusId() in [SELECT]: diff --git a/resources/skins/Default/720p/InfoWindow.xml b/resources/skins/Default/720p/InfoWindow.xml index ad013bf6..39caf843 100644 --- a/resources/skins/Default/720p/InfoWindow.xml +++ b/resources/skins/Default/720p/InfoWindow.xml @@ -6,18 +6,6 @@ 0 - - - 0 - 0 - 100% - 100% - white.png - white.png - WindowOpen - WindowClose - Action(close) - 0 @@ -48,6 +36,19 @@ Conditional + + 40 + 40 + 50 + 50 + FFFFFFFF + center + center + close.png + close.png + 30002 + + 40 @@ -56,6 +57,7 @@ wrap horizontal 300 + 30003