From bca7074dcef4fabbc3488de46db495103da216d3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sat, 24 Dec 2022 11:04:42 -0500 Subject: [PATCH] [5] catch TMDb Not Found --- VERSION | 2 +- modules/convert.py | 9 ++++++--- modules/operations.py | 9 +++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index d9f5b8c7..20194f55 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.1-develop4 +1.18.1-develop5 diff --git a/modules/convert.py b/modules/convert.py index f3caa56a..5778baae 100644 --- a/modules/convert.py +++ b/modules/convert.py @@ -22,10 +22,13 @@ class Convert: for anidb_id, ids in self._anidb_ids.items(): anidb_id = int(anidb_id) if "mal_id" in ids: - self._mal_to_anidb[int(ids["mal_id"])] = anidb_id - self._anidb_to_mal[int(anidb_id)] = int(ids["mal_id"]) + for mal_id in util.get_list(ids["mal_id"], int_list=True): + self._mal_to_anidb[mal_id] = anidb_id + if anidb_id not in self._anidb_to_mal: + self._anidb_to_mal[anidb_id] = mal_id if "anilist_id" in ids: - self._anilist_to_anidb[int(ids["anilist_id"])] = anidb_id + for anilist_id in util.get_list(ids["anilist_id"], int_list=True): + self._anilist_to_anidb[anilist_id] = anidb_id if "imdb_id" in ids and str(ids["imdb_id"]).startswith("tt"): self._anidb_to_imdb[anidb_id] = util.get_list(ids["imdb_id"]) for im_id in util.get_list(ids["imdb_id"]): diff --git a/modules/operations.py b/modules/operations.py index 77d74803..e5212743 100644 --- a/modules/operations.py +++ b/modules/operations.py @@ -582,8 +582,13 @@ class Operations: logger.info(f"{season.title} Background | Reset from {background_location}") else: logger.info(f"{season.title} Background | No Reset Image Found") - - tmdb_episodes = {e.episode_number: e for e in tmdb_seasons[season.seasonNumber].episodes} if season.seasonNumber in tmdb_seasons else {} + tmdb_episodes = {} + if season.seasonNumber in tmdb_seasons: + for episode in tmdb_seasons[season.seasonNumber].episodes: + try: + tmdb_episodes[episode.episode_number] = episode + except NotFound: + logger.error(f"TMDb Error: An Episode of Season {season.seasonNumber} was Not Found") for episode in self.library.query(season.episodes): try: