From 4cea31bee6d0273e153f6127453bfc35ff5a7b6c Mon Sep 17 00:00:00 2001 From: Joseph Date: Tue, 22 Oct 2024 12:21:12 -0700 Subject: [PATCH] [7] Bug Fix: Fix AniDb ID lookup (#2285) --- CHANGELOG | 1 + VERSION | 2 +- modules/convert.py | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8ade124af..54c61427b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,3 +14,4 @@ Fixes an issue where Prime Video overlays/collections would not be built when th Fixed the `cast` search option for the `imdb_search` builder Fixes #2258 `imdb_list` sort was not being parsed correctly Fixes `letterboxd_list` rating filter to use a 1-10 rating vs 1-100 to reflect how letterboxd ratings work on their website +Fixed the `ids_to_anidb` lookup for anime movies and shows diff --git a/VERSION b/VERSION index 51e5a6efe..e16c43200 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-build6 +2.1.0-build7 diff --git a/modules/convert.py b/modules/convert.py index 1d4541867..fcd02b053 100644 --- a/modules/convert.py +++ b/modules/convert.py @@ -48,11 +48,11 @@ def __init__(self, requests, cache, tmdb): if "tmdb_movie_id" in ids: self._anidb_to_tmdb_movie[anidb_id] = util.get_list(ids["tmdb_movie_id"]) for tm_id in util.get_list(ids["tmdb_movie_id"]): - self._tmdb_movie_to_anidb[tm_id] = anidb_id + self._tmdb_movie_to_anidb[int(tm_id)] = anidb_id if "tmdb_show_id" in ids: self._anidb_to_tmdb_show[anidb_id] = util.get_list(ids["tmdb_show_id"]) for tm_id in util.get_list(ids["tmdb_show_id"]): - self._tmdb_show_to_anidb[tm_id] = anidb_id + self._tmdb_show_to_anidb[int(tm_id)] = anidb_id def imdb_to_anidb(self, imdb_id): if imdb_id in self._imdb_to_anidb: @@ -73,12 +73,12 @@ def ids_to_anidb(self, library, rating_key, tvdb_id, imdb_id, tmdb_id): return self._tvdb_to_anidb[int(tvdb_id)] else: tmdb_show_id = self.tvdb_to_tmdb(tvdb_id) if tvdb_id else None - if tmdb_show_id and tmdb_show_id in self._tmdb_show_to_anidb: - return self._tmdb_show_to_anidb[tmdb_show_id] + if tmdb_show_id and int(tmdb_show_id) in self._tmdb_show_to_anidb: + return self._tmdb_show_to_anidb[int(tmdb_show_id)] elif imdb_id in self._imdb_to_anidb: return self._imdb_to_anidb[imdb_id] - elif tmdb_id in self._tmdb_movie_to_anidb: - return self._tmdb_movie_to_anidb[tmdb_id] + elif tmdb_id and int(tmdb_id) in self._tmdb_movie_to_anidb: + return self._tmdb_movie_to_anidb[int(tmdb_id)] else: return None