[2] Fixed multiple anime `int()` Errors (#2099)

pull/2104/head
meisnate12 6 months ago committed by GitHub Action
parent e4c5ef60ab
commit 3af2dee7c5

@ -10,5 +10,6 @@ Added [`letterboxd_user_lists`](https://kometa.wiki/en/latest/files/dynamic_type
# Defaults
# Bug Fixes
Fixed multiple anime `int()` Errors
Various other Minor Fixes

@ -1 +1 @@
2.0.2-build1
2.0.2-build2

@ -2234,6 +2234,7 @@ class CollectionBuilder:
logger.trace(f"IDs: {ids}")
logger.debug("")
for i, input_data in enumerate(ids, 1):
try:
input_id, id_type = input_data
logger.ghost(f"Parsing ID {i}/{total_ids}")
rating_keys = []
@ -2381,7 +2382,6 @@ class CollectionBuilder:
rating_keys = found_keys
else:
continue
if not isinstance(rating_keys, list):
rating_keys = [rating_keys]
for rk in rating_keys:
@ -2407,6 +2407,10 @@ class CollectionBuilder:
items.append(item)
except Failed as e:
logger.error(e)
except Exception as e:
logger.stacktrace()
logger.error(e)
logger.info(input_data)
logger.exorcise()
if not items:
return None

@ -69,10 +69,10 @@ class Convert:
def ids_to_anidb(self, library, rating_key, tvdb_id, imdb_id, tmdb_id):
if rating_key in library.reverse_anidb:
return library.reverse_anidb[rating_key]
elif int(tvdb_id) in self._tvdb_to_anidb:
elif tvdb_id and int(tvdb_id) in self._tvdb_to_anidb:
return self._tvdb_to_anidb[int(tvdb_id)]
else:
tmdb_show_id = self.tvdb_to_tmdb(tvdb_id)
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]
elif imdb_id in self._imdb_to_anidb:
@ -109,7 +109,6 @@ class Convert:
added = True
if added is False and anidb_id in self._anidb_to_tvdb:
ids.append((self._anidb_to_tvdb[anidb_id], "tvdb"))
ids.append((self._anidb_to_tmdb_movie[anidb_id], "tmdb"))
elif anidb_id in self._anidb_to_tvdb:
ids.append((self._anidb_to_tvdb[anidb_id], "tvdb"))
elif anidb_id in self._anidb_to_tmdb_show:
@ -118,7 +117,6 @@ class Convert:
ids.append((int(self.tmdb_to_tvdb(tmdb_id, fail=True)), "tvdb"))
except Failed:
pass
ids.append((self._anidb_to_tmdb_show[anidb_id], "tmdb"))
elif str(anidb_id) in self._anidb_ids:
logger.warning(f"Convert Warning: No TVDb ID or IMDb ID found for AniDB ID: {anidb_id}")
else:

Loading…
Cancel
Save