From 44b5cfac27c89d20596b5c87b503855faa2fcb9e Mon Sep 17 00:00:00 2001 From: marco <10120390+mac12m99@users.noreply.github.com> Date: Wed, 30 Dec 2020 11:27:18 +0100 Subject: [PATCH] =?UTF-8?q?fix=20novit=C3=A0=20su=20kodi=2019=20e=20altri?= =?UTF-8?q?=20fix=20minori?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channelselector.py | 3 --- core/downloader.py | 4 ++-- core/trakt_tools.py | 2 +- platformcode/download_and_play.py | 12 ++++++------ specials/news.py | 4 ++-- specials/trailertools.py | 2 +- specials/videolibrary.py | 5 ++++- tests/test_generic.py | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/channelselector.py b/channelselector.py index eb806c03..cb72988c 100644 --- a/channelselector.py +++ b/channelselector.py @@ -12,9 +12,6 @@ def getmainlist(view="thumb_"): logger.debug() itemlist = list() - if config.dev_mode(): - itemlist.append(Item(title="Redirect", action="check_channels", thumbnail='', - category=config.get_localized_string(30119), viewmode="thumbnails")) # Main Menu Channels if addon.getSetting('enable_news_menu') == "true": itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist", diff --git a/core/downloader.py b/core/downloader.py index 919f9469..0014f126 100644 --- a/core/downloader.py +++ b/core/downloader.py @@ -142,9 +142,9 @@ class Downloader(object): # We stop downloading self._state = self.states.stopped for t in self._threads: - if t.isAlive(): t.join() + if t.is_alive(): t.join() - if self._save_thread.isAlive(): self._save_thread.join() + if self._save_thread.is_alive(): self._save_thread.join() if self._seekable: # Guardamos la info al final del archivo diff --git a/core/trakt_tools.py b/core/trakt_tools.py index 639c8803..ecd94ffd 100644 --- a/core/trakt_tools.py +++ b/core/trakt_tools.py @@ -269,7 +269,7 @@ def wait_for_update_trakt(): t = Thread(update_all) t.setDaemon(True) t.start() - t.isAlive() + t.is_alive() def update_all(): # from core.support import dbg;dbg() diff --git a/platformcode/download_and_play.py b/platformcode/download_and_play.py index 24bc68a1..dab22601 100644 --- a/platformcode/download_and_play.py +++ b/platformcode/download_and_play.py @@ -40,7 +40,7 @@ def download_and_play(url, file_name, download_path): dialog.create(config.get_localized_string(60200), config.get_localized_string(60312)) dialog.update(0) - while not cancelled and download_thread.isAlive(): + while not cancelled and download_thread.is_alive(): dialog.update(download_thread.get_progress(), config.get_localized_string(60313) + '\n' + config.get_localized_string(60314) + str(int(old_div(download_thread.get_speed(), 1024))) + " KB/s " + str( download_thread.get_actual_size()) + config.get_localized_string(60316) + str( download_thread.get_total_size()) + "MB", @@ -67,15 +67,15 @@ def download_and_play(url, file_name, download_path): logger.info("Terminated by user") break else: - if not download_thread.isAlive(): + if not download_thread.is_alive(): logger.info("Download has finished") break else: logger.info("Continua la descarga") # When the player finishes, if you continue downloading it for now - logger.info("Download thread alive=" + str(download_thread.isAlive())) - if download_thread.isAlive(): + logger.info("Download thread alive=" + str(download_thread.is_alive())) + if download_thread.is_alive(): logger.info("Killing download thread") download_thread.force_stop() @@ -106,11 +106,11 @@ class CustomPlayer(xbmc.Player): def force_stop_download_thread(self): logger.info() - if self.download_thread.isAlive(): + if self.download_thread.is_alive(): logger.info("Killing download thread") self.download_thread.force_stop() - # while self.download_thread.isAlive(): + # while self.download_thread.is_alive(): # xbmc.sleep(1000) def onPlayBackStarted(self): diff --git a/specials/news.py b/specials/news.py index 17e2289e..4f830a59 100644 --- a/specials/news.py +++ b/specials/news.py @@ -290,7 +290,7 @@ def novedades(item): # Multi Thread mode: wait for all threads to finish if multithread: - pendent = [a for a in threads if a.isAlive()] + pendent = [a for a in threads if a.is_alive()] t = float(100) / len(pendent) while pendent: index = (len(threads) - len(pendent)) + 1 @@ -308,7 +308,7 @@ def novedades(item): break time.sleep(0.5) - pendent = [a for a in threads if a.isAlive()] + pendent = [a for a in threads if a.is_alive()] if mode == 'normal': mensaje = config.get_localized_string(60522) % (len(list_newest), time.time() - start_time) progreso.update(100, mensaje) diff --git a/specials/trailertools.py b/specials/trailertools.py index e2230931..0ebeecc0 100644 --- a/specials/trailertools.py +++ b/specials/trailertools.py @@ -358,11 +358,11 @@ try: self.control_list.addItems(self.items) self.setFocus(self.control_list) def onClick(self, id): + global window_select, result # Cancel button y [X] if id == 7: window_select[-1].close() if id == 5: - global window_select, result self.result = "_no_video" result = "no_video" self.close() diff --git a/specials/videolibrary.py b/specials/videolibrary.py index 723f9c1c..79f586e8 100644 --- a/specials/videolibrary.py +++ b/specials/videolibrary.py @@ -394,7 +394,10 @@ def findvideos(item): logger.debug("Unable to search for videos due to lack of parameters") return [] - content_title = str(item.contentSeason) + 'x' + (str(item.contentEpisodeNumber) if item.contentEpisodeNumber > 9 else '0' + str(item.contentEpisodeNumber)) + if item.contentEpisodeNumber: + content_title = str(item.contentSeason) + 'x' + (str(item.contentEpisodeNumber) if item.contentEpisodeNumber > 9 else '0' + str(item.contentEpisodeNumber)) + else: + content_title = item.contentTitle.strip().lower() if item.contentType == 'movie': item.strm_path = filetools.join(videolibrarytools.MOVIES_PATH, item.strm_path) path_dir = filetools.dirname(item.strm_path) diff --git a/tests/test_generic.py b/tests/test_generic.py index 483ec1a8..88200568 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -142,7 +142,7 @@ servers = [] channels = [] channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")] -logger.info(channel_list) +logger.info([c.channel for c in channel_list]) ret = [] logger.record = True