Skip to content

Commit

Permalink
fix: handle array of season numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
pikdum committed May 4, 2024
1 parent d869c4c commit b80620c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mona.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def get_search_string(parsed: dict[str, str]) -> str | None:
return search_string


async def get_season_image(tvdb_id: int, season_number: str) -> str | None:
async def get_season_image(tvdb_id: int, season_number: str | list[str]) -> str | None:
if not season_number or not tvdb_id:
return None
season_number = (
season_number if isinstance(season_number, str) else season_number[0]
)
series = await tvdb.get_series_extended(tvdb_id)
if not series or not (seasons := series.get("seasons")):
return None
Expand Down

0 comments on commit b80620c

Please sign in to comment.