Hiveworks - Add Chapter Filtering (#2463)

* Add chapter filtering

- Better supports Check Please Comic and others if needed

* Use better code
This commit is contained in:
happywillow0 2020-03-20 14:19:38 -04:00 committed by GitHub
parent bc49af1d14
commit b4e563a135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Hiveworks Comics' appName = 'Tachiyomi: Hiveworks Comics'
pkgNameSuffix = 'en.hiveworks' pkgNameSuffix = 'en.hiveworks'
extClass = '.Hiveworks' extClass = '.Hiveworks'
extVersionCode = 2 extVersionCode = 3
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -184,6 +184,7 @@ class Hiveworks : ParsedHttpSource() {
} }
override fun chapterListParse(response: Response): List<SChapter> { override fun chapterListParse(response: Response): List<SChapter> {
val url = response.request().url().toString()
val document = response.asJsoup() val document = response.asJsoup()
val baseUrl = document.select("div script").html().substringAfter("href='").substringBefore("'") val baseUrl = document.select("div script").html().substringAfter("href='").substringBefore("'")
val elements = document.select(chapterListSelector()) val elements = document.select(chapterListSelector())
@ -192,6 +193,9 @@ class Hiveworks : ParsedHttpSource() {
for (i in 1 until elements.size) { for (i in 1 until elements.size) {
chapters.add(createChapter(elements[i], baseUrl)) chapters.add(createChapter(elements[i], baseUrl))
} }
when {
"checkpleasecomic" in url -> chapters.retainAll { it.name.endsWith("01") || it.name.endsWith(" 1") }
}
chapters.reverse() chapters.reverse()
return chapters return chapters
} }