Skip to content

Commit

Permalink
[7] Bug Fix: Fix AniDb ID lookup (#2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
salomj authored and actions-user committed Oct 22, 2024
1 parent 55049a5 commit 4cea31b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0-build6
2.1.0-build7
12 changes: 6 additions & 6 deletions modules/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 4cea31b

Please sign in to comment.