From b4e563a1359e189187cec3a231c6689421f24b16 Mon Sep 17 00:00:00 2001 From: happywillow0 <45346080+happywillow0@users.noreply.github.com> Date: Fri, 20 Mar 2020 14:19:38 -0400 Subject: [PATCH] Hiveworks - Add Chapter Filtering (#2463) * Add chapter filtering - Better supports Check Please Comic and others if needed * Use better code --- src/en/hiveworks/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/en/hiveworks/Hiveworks.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/en/hiveworks/build.gradle b/src/en/hiveworks/build.gradle index 4142396bb..2fd64b9e1 100644 --- a/src/en/hiveworks/build.gradle +++ b/src/en/hiveworks/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Hiveworks Comics' pkgNameSuffix = 'en.hiveworks' extClass = '.Hiveworks' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/hiveworks/src/eu/kanade/tachiyomi/extension/en/hiveworks/Hiveworks.kt b/src/en/hiveworks/src/eu/kanade/tachiyomi/extension/en/hiveworks/Hiveworks.kt index 1f2893b98..37d65c48e 100644 --- a/src/en/hiveworks/src/eu/kanade/tachiyomi/extension/en/hiveworks/Hiveworks.kt +++ b/src/en/hiveworks/src/eu/kanade/tachiyomi/extension/en/hiveworks/Hiveworks.kt @@ -184,6 +184,7 @@ class Hiveworks : ParsedHttpSource() { } override fun chapterListParse(response: Response): List { + val url = response.request().url().toString() val document = response.asJsoup() val baseUrl = document.select("div script").html().substringAfter("href='").substringBefore("'") val elements = document.select(chapterListSelector()) @@ -192,6 +193,9 @@ class Hiveworks : ParsedHttpSource() { for (i in 1 until elements.size) { chapters.add(createChapter(elements[i], baseUrl)) } + when { + "checkpleasecomic" in url -> chapters.retainAll { it.name.endsWith("01") || it.name.endsWith(" 1") } + } chapters.reverse() return chapters }