pull/50/head
meisnate12 4 years ago
parent 06671fc912
commit e11f19c04c

@ -89,9 +89,9 @@ class TraktAPI:
lookup = Trakt["search"].lookup(external_id, from_source, media_type) lookup = Trakt["search"].lookup(external_id, from_source, media_type)
if lookup: if lookup:
lookup = lookup[0] if isinstance(lookup, list) else lookup lookup = lookup[0] if isinstance(lookup, list) else lookup
return lookup.get_key(to_source) if to_source == "imdb" else int(lookup.get_key(to_source)) if lookup.get_key(to_source)):
else: return lookup.get_key(to_source) if to_source == "imdb" else int(lookup.get_key(to_source))
raise Failed("No {} ID found for {} ID {}".format(to_source.upper().replace("B", "b"), from_source.upper().replace("B", "b"), external_id)) raise Failed("No {} ID found for {} ID {}".format(to_source.upper().replace("B", "b"), from_source.upper().replace("B", "b"), external_id))
@retry(stop_max_attempt_number=6, wait_fixed=10000) @retry(stop_max_attempt_number=6, wait_fixed=10000)
def trending(self, amount, is_movie): def trending(self, amount, is_movie):

Loading…
Cancel
Save