From 7ea59a7bf179e283d96e94b3c21f6c9f98218fa1 Mon Sep 17 00:00:00 2001 From: Draken <131387159+dragonx943@users.noreply.github.com> Date: Sun, 4 May 2025 16:01:34 +0700 Subject: [PATCH] [HeanCms] Small improvements (#1751) Co-authored-by: Draken --- .../org/koitharu/kotatsu/parsers/site/heancms/HeanCms.kt | 6 +++++- .../kotatsu/parsers/site/heancms/en/ReaperComics.kt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/HeanCms.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/HeanCms.kt index c55a3389..302c61e1 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/HeanCms.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/HeanCms.kt @@ -143,9 +143,13 @@ internal abstract class HeanCms( protected open val datePattern = "yyyy-MM-dd" + protected open fun reqUrl(seriesId: Long): String { + return "https://$apiPath/chapter/query?page=1&perPage=9999&series_id=$seriesId" + } + override suspend fun getDetails(manga: Manga): Manga { val seriesId = manga.url.toLongOrNull() ?: manga.id // backward compatibility - val url = "https://$apiPath/chapter/query?page=1&perPage=9999&series_id=$seriesId" + val url = reqUrl(seriesId) // keep old API url, can replace it val response = webClient.httpGet(url).parseJson() val data = response.getJSONArray("data").asTypedList() val dateFormat = SimpleDateFormat(datePattern, Locale.ENGLISH) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/en/ReaperComics.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/en/ReaperComics.kt index 5cec88c4..e4b8cf57 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/en/ReaperComics.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/heancms/en/ReaperComics.kt @@ -11,4 +11,8 @@ internal class ReaperComics(context: MangaLoaderContext) : override val cdn = "media.reaperscans.com/file/4SRBHm//" override val paramsUpdated = "updated_at" override val selectPages = ".flex > img" -} + + override fun reqUrl(seriesId: Long): String { + return "https://$apiPath/chapters/$seriesId?page=1&perPage=9999&order=desc" + } +} \ No newline at end of file