diff options
Diffstat (limited to 'lib/anilist')
| -rw-r--r-- | lib/anilist/aniAdvanceSearch.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/anilist/aniAdvanceSearch.js b/lib/anilist/aniAdvanceSearch.js index cf344b0..7e684af 100644 --- a/lib/anilist/aniAdvanceSearch.js +++ b/lib/anilist/aniAdvanceSearch.js @@ -27,14 +27,15 @@ export async function aniAdvanceSearch({ const response = await fetch("https://api.anify.tv/search-advanced", { method: "POST", body: JSON.stringify({ - type: "manga", - genres: categorizedGenres, + sort: "averageRating", + sortDirection: "DESC", + ...(categorizedGenres && { ...categorizedGenres }), ...(search && { query: search }), ...(page && { page: page }), ...(perPage && { perPage: perPage }), - ...(format && { format: format }), - ...(seasonYear && { year: seasonYear }), - ...(type && { type: type }), + ...(format && { format: [format] }), + ...(seasonYear && { year: Number(seasonYear) }), + ...(type && { type: format === "NOVEL" ? "novel" : type }), }), }); |