diff --git a/src/en/cloudrecess/build.gradle b/src/en/cloudrecess/build.gradle index 50cb3333c..6bb1a94db 100644 --- a/src/en/cloudrecess/build.gradle +++ b/src/en/cloudrecess/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'CloudRecess' pkgNameSuffix = 'en.cloudrecess' extClass = '.CloudRecess' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/en/cloudrecess/src/eu/kanade/tachiyomi/extension/en/cloudrecess/CloudRecess.kt b/src/en/cloudrecess/src/eu/kanade/tachiyomi/extension/en/cloudrecess/CloudRecess.kt index daabf14a7..52af9e3a8 100644 --- a/src/en/cloudrecess/src/eu/kanade/tachiyomi/extension/en/cloudrecess/CloudRecess.kt +++ b/src/en/cloudrecess/src/eu/kanade/tachiyomi/extension/en/cloudrecess/CloudRecess.kt @@ -128,6 +128,27 @@ class CloudRecess : ParsedHttpSource() { // ============================== Chapters ============================== override fun chapterListSelector() = "div#chapters-list > a[href]" + override fun chapterListParse(response: Response): List { + val originalUrl = response.request.url.toString() + + val chapterList = buildList { + var page = 1 + do { + val doc = when { + isEmpty() -> response // First page + else -> { + page++ + client.newCall(GET("$originalUrl?page=$page", headers)).execute() + } + }.use { it.asJsoup() } + + addAll(doc.select(chapterListSelector()).map(::chapterFromElement)) + } while (doc.selectFirst(latestUpdatesNextPageSelector()) != null) + } + + return chapterList + } + override fun chapterFromElement(element: Element) = SChapter.create().apply { setUrlWithoutDomain(element.attr("href")) name = element.selectFirst("span")?.ownText() ?: "Chapter"