ReadM fix manga Status (#4859)

manga status not included(recently added)
This commit is contained in:
Riztard Lanthorn 2020-11-13 19:10:52 +07:00 committed by GitHub
parent 924ea25c53
commit 15f38383b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'ReadM'
pkgNameSuffix = 'en.readm'
extClass = '.ReadM'
extVersionCode = 3
extVersionCode = 4
libVersion = '1.2'
}

View File

@ -95,6 +95,14 @@ class ReadM : ParsedHttpSource() {
artist = document.select("span#last_episode a").text().trim()
description = document.select("div.series-summary-wrapper p").text().trim()
genre = document.select("div.series-summary-wrapper div.item a").joinToString(", ") { it.text().trim() }
status = parseStatus(document.select("div.series-genres .series-status").firstOrNull()?.ownText())
}
protected fun parseStatus(element: String?): Int = when {
element == null -> SManga.UNKNOWN
listOf("ongoing").any { it.contains(element, ignoreCase = true) } -> SManga.ONGOING
listOf("completed").any { it.contains(element, ignoreCase = true) } -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
// Chapters