ReadM fix manga Status (#4859)
manga status not included(recently added)
This commit is contained in:
parent
924ea25c53
commit
15f38383b3
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'ReadM'
|
extName = 'ReadM'
|
||||||
pkgNameSuffix = 'en.readm'
|
pkgNameSuffix = 'en.readm'
|
||||||
extClass = '.ReadM'
|
extClass = '.ReadM'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,14 @@ class ReadM : ParsedHttpSource() {
|
||||||
artist = document.select("span#last_episode a").text().trim()
|
artist = document.select("span#last_episode a").text().trim()
|
||||||
description = document.select("div.series-summary-wrapper p").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() }
|
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
|
// Chapters
|
||||||
|
|
Loading…
Reference in New Issue