From 92af716ed9771a81e69010b253a7ed84fa5be632 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 27 Apr 2024 13:42:08 -0400 Subject: [PATCH] Update anime-score.js --- commands/games-sp/anime-score.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/commands/games-sp/anime-score.js b/commands/games-sp/anime-score.js index 91a0f4d9..8d1cae76 100644 --- a/commands/games-sp/anime-score.js +++ b/commands/games-sp/anime-score.js @@ -8,6 +8,8 @@ const searchGraphQL = stripIndents` Page (page: $page) { pageInfo { total + lastPage + perPage } media (type: $type, popularity_greater: 50000, isAdult: false, averageScore_not: 0, sort: POPULARITY_DESC) { id @@ -98,8 +100,7 @@ module.exports = class AnimeScoreCommand extends Command { .send({ variables: { page: Math.ceil(selectedAnime / 50), - type: 'ANIME', - isAdult: false + type: 'ANIME' }, query: searchGraphQL }); @@ -119,12 +120,12 @@ module.exports = class AnimeScoreCommand extends Command { .send({ variables: { page: 0, - type: 'ANIME', - isAdult: false + type: 'ANIME' }, query: searchGraphQL }); - this.totalAnime = body.data.Page.pageInfo.total; + const pageInfo = body.data.Page.pageInfo; + this.totalAnime = pageInfo.lastPage * pageInfo.perPage; setTimeout(() => { this.totalAnime = null; }, 2.16e+7); return this.totalAnime; }