diff --git a/pyproject.toml b/pyproject.toml index 2640fc7..85fada5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ dependencies = [ "httpx>=0.28.1", "jinja2>=3.1.6", "komgapi", + "limit>=0.2.3", "quart>=0.20.0", ] diff --git a/src/app.py b/src/app.py index d58b301..41d80d9 100644 --- a/src/app.py +++ b/src/app.py @@ -36,12 +36,15 @@ async def fetch_data( ) -> List[Dict[str, Any]]: async with httpx.AsyncClient() as client: try: - variables: Dict[str, Any] = {"search": data["query"], "type": "MANGA"} + variables: Dict[str, Any] = {"search": data["query"]} if data.get("genres"): variables["genres"] = data["genres"] if data.get("tags"): variables["tags"] = data["tags"] - # print(data["query"], variables) + if data.get("type"): + if data["type"] in ["MANGA", "NOVEL"]: + variables["format"] = data["type"] + print(data["query"], variables) response = await client.post( "https://graphql.anilist.co", json={ diff --git a/src/templates/index.html b/src/templates/index.html index 6b66161..7387e41 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -14,6 +14,7 @@