Skip to content

Commit

Permalink
actually validate inner data
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractUmbra committed Jul 14, 2024
1 parent eb47e5c commit b1f83e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions anilist-cmp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_common_planning(data: AnilistResponse) -> dict[int, InnerMediaEntry]:
media_entries: list[dict[int, InnerMediaEntry]] = []

for index, item in enumerate(data["data"].values()):
if not item:
if not item or not item["lists"]:
raise NoPlanningData(index)

media_entries.append(_restructure_entries(item["lists"][0]["entries"]))
Expand Down Expand Up @@ -247,4 +247,8 @@ async def get_matches(user_list: str, exclude: list[str] | None = None, status:
)


app = Litestar(route_handlers=[index, get_matches], middleware=[RL_CONFIG.middleware])
app = Litestar(
route_handlers=[index, get_matches],
middleware=[RL_CONFIG.middleware],
debug=True,
)

0 comments on commit b1f83e9

Please sign in to comment.