From 0fe944f4fab1d3492825618a0804ad3aee823c62 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Tue, 3 Oct 2023 18:16:27 +0000 Subject: [PATCH] FIX kakaopage : fix getChapters (#6266) changed graphql request --- src/web/mjs/connectors/kakaopage.mjs | 107 ++++++++++++++------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/src/web/mjs/connectors/kakaopage.mjs b/src/web/mjs/connectors/kakaopage.mjs index c7bfd68b2a9..0774a99b071 100644 --- a/src/web/mjs/connectors/kakaopage.mjs +++ b/src/web/mjs/connectors/kakaopage.mjs @@ -50,6 +50,7 @@ export default class kakaopage extends Connector { } async _getChaptersFromPage(manga, nextCursor) { + const gql = { operationName: 'contentHomeProductList', variables: { @@ -58,56 +59,62 @@ export default class kakaopage extends Connector { sortType : 'asc', after : nextCursor, }, - query: `query contentHomeProductList($after: String, $before: String, $first: Int, $last: Int, $seriesId: Long!, $boughtOnly: Boolean, $sortType: String) { - contentHomeProductList( - seriesId: $seriesId - after: $after - before: $before - first: $first - last: $last - boughtOnly: $boughtOnly - sortType: $sortType - ) { - totalCount - pageInfo { - hasNextPage - endCursor - hasPreviousPage - startCursor - __typename - } - edges { - cursor - node { - ...SingleListViewItem - __typename - } - __typename - } - __typename - } - } - - fragment SingleListViewItem on SingleListViewItem { - id - type - thumbnail - isCheckMode - isChecked - scheme - single { - productId - ageGrade - id - isFree - thumbnail - title - slideType - __typename - } - isViewed - purchaseInfoText - } + query: `query contentHomeProductList( + $after: String + $before: String + $first: Int + $last: Int + $seriesId: Long! + $boughtOnly: Boolean + $sortType: String + ) { + contentHomeProductList( + seriesId: $seriesId + after: $after + before: $before + first: $first + last: $last + boughtOnly: $boughtOnly + sortType: $sortType + ) { + totalCount + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + selectedSortOption { + id + name + param + } + sortOptionList { + id + name + param + } + edges { + cursor + node { + ...SingleListViewItem + } + } + } + } + + fragment SingleListViewItem on SingleListViewItem { + id + type + single { + productId + id + isFree + thumbnail + title + slideType + } + } ` }; return await this.fetchGraphQL(this.url+'/graphql', gql.operationName, gql.query, gql.variables );