feat: add type selector and limit results based on set type
This commit is contained in:
@@ -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={
|
||||
|
||||
Reference in New Issue
Block a user