Skip to content

Commit

Permalink
fix(coffeeani): Filter Nones from anilist names
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeebank committed Nov 1, 2023
1 parent c4966ab commit 48ad54f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion coffeeani/coffeeani_utils/sources/anilist.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ def anilist_get_names(media_result):
am_name_native = []
am_name_native.append(media_result['title'].get('native', None))
am_name_native.append(media_result['title'].get('romaji', None))
return am_name_native
am_name_native_final = list(filter(None, am_name_native))
if len(am_name_native_final) <= 0:
return None
return am_name_native_final

def anilist_get_next_airing_episode(media_result):
if media_result.get("nextAiringEpisode"):
Expand Down

0 comments on commit 48ad54f

Please sign in to comment.