From 8f0a4c8903bcb7385e0e79a5f1268a937da39c37 Mon Sep 17 00:00:00 2001 From: Muhamad Aris Date: Fri, 2 Sep 2022 04:55:04 +0700 Subject: [PATCH] Komikcast: fix broken pagination (#13280) * fix: latest update pagination & popular page * update overrideVersionCode * Apply suggestions from code review Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> * remove slash to fix 301 redirect Co-authored-by: Aris Co-authored-by: Alessandro Jean <14254807+alessandrojean@users.noreply.github.com> --- .../mangathemesia/komikcast/src/KomikCast.kt | 11 ++++++++++- .../multisrc/mangathemesia/MangaThemesiaGenerator.kt | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/multisrc/overrides/mangathemesia/komikcast/src/KomikCast.kt b/multisrc/overrides/mangathemesia/komikcast/src/KomikCast.kt index 08583c65f..b35b4175d 100644 --- a/multisrc/overrides/mangathemesia/komikcast/src/KomikCast.kt +++ b/multisrc/overrides/mangathemesia/komikcast/src/KomikCast.kt @@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit class KomikCast : MangaThemesia( "Komik Cast", - "https://komikcast.me", + baseUrl = "https://komikcast.me", "id", mangaUrlDirectory = "/daftar-komik" ) { @@ -45,6 +45,15 @@ class KomikCast : MangaThemesia( return GET(page.imageUrl!!, newHeaders) } + override fun popularMangaRequest(page: Int) = customPageRequest(page, "orderby", "popular") + override fun latestUpdatesRequest(page: Int) = customPageRequest(page, "sortby", "update") + + private fun customPageRequest(page: Int, filterKey: String, filterValue: String): Request { + val pagePath = if (page > 1) "page/$page/" else "" + + return GET("$baseUrl$mangaUrlDirectory/$pagePath?$filterKey=$filterValue", headers) + } + override fun searchMangaSelector() = "div.list-update_item" override fun searchMangaFromElement(element: Element) = super.searchMangaFromElement(element).apply { diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt index a435fe486..ea3a13dac 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt @@ -39,7 +39,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { SingleLang("Kiryuu", "https://kiryuu.id", "id", overrideVersionCode = 6), SingleLang("KlanKomik", "https://klankomik.com", "id", overrideVersionCode = 1), SingleLang("Komik AV", "https://komikav.com", "id", overrideVersionCode = 1), - SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 12), + SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 13), SingleLang("Komik Lab", "https://komiklab.com", "id"), SingleLang("Komik Station", "https://komikstation.co", "id", overrideVersionCode = 3), SingleLang("KomikIndo.co", "https://komikindo.co", "id", className = "KomikindoCo", overrideVersionCode = 3),