Batoto: Fix extra info + Hide empty alt titles + Fall back to upload status (#7312)
Fix extra info + Hide empty alt titles + Fall back to upload status
This commit is contained in:
parent
b0eda7b44d
commit
944586408e
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Bato.to'
|
extName = 'Bato.to'
|
||||||
extClass = '.BatoToFactory'
|
extClass = '.BatoToFactory'
|
||||||
extVersionCode = 46
|
extVersionCode = 47
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,9 +346,9 @@ open class BatoTo(
|
||||||
append("\n\n${it.text()}")
|
append("\n\n${it.text()}")
|
||||||
}
|
}
|
||||||
infoElement.selectFirst("h5:containsOwn(Extra Info:) + div")?.also {
|
infoElement.selectFirst("h5:containsOwn(Extra Info:) + div")?.also {
|
||||||
append("\n\nExtra Info:\n${it.text()}")
|
append("\n\nExtra Info:\n${it.wholeText()}")
|
||||||
}
|
}
|
||||||
document.selectFirst("div.pb-2.alias-set.line-b-f")?.also {
|
document.selectFirst("div.pb-2.alias-set.line-b-f")?.takeIf { it.hasText() }?.also {
|
||||||
append("\n\nAlternative Titles:\n")
|
append("\n\nAlternative Titles:\n")
|
||||||
append(it.text().split('/').joinToString("\n") { "• ${it.trim()}" })
|
append(it.text().split('/').joinToString("\n") { "• ${it.trim()}" })
|
||||||
}
|
}
|
||||||
|
@ -369,17 +369,20 @@ open class BatoTo(
|
||||||
manga.thumbnail_url = document.select("div.attr-cover img").attr("abs:src")
|
manga.thumbnail_url = document.select("div.attr-cover img").attr("abs:src")
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
private fun parseStatus(workStatus: String?, uploadStatus: String?) = when {
|
private fun parseStatus(workStatus: String?, uploadStatus: String?): Int {
|
||||||
workStatus == null -> SManga.UNKNOWN
|
val status = workStatus ?: uploadStatus
|
||||||
workStatus.contains("Ongoing") -> SManga.ONGOING
|
return when {
|
||||||
workStatus.contains("Cancelled") -> SManga.CANCELLED
|
status == null -> SManga.UNKNOWN
|
||||||
workStatus.contains("Hiatus") -> SManga.ON_HIATUS
|
status.contains("Ongoing") -> SManga.ONGOING
|
||||||
workStatus.contains("Completed") -> when {
|
status.contains("Cancelled") -> SManga.CANCELLED
|
||||||
|
status.contains("Hiatus") -> SManga.ON_HIATUS
|
||||||
|
status.contains("Completed") -> when {
|
||||||
uploadStatus?.contains("Ongoing") == true -> SManga.PUBLISHING_FINISHED
|
uploadStatus?.contains("Ongoing") == true -> SManga.PUBLISHING_FINISHED
|
||||||
else -> SManga.COMPLETED
|
else -> SManga.COMPLETED
|
||||||
}
|
}
|
||||||
else -> SManga.UNKNOWN
|
else -> SManga.UNKNOWN
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun altChapterParse(response: Response): List<SChapter> {
|
private fun altChapterParse(response: Response): List<SChapter> {
|
||||||
return Jsoup.parse(response.body.string(), response.request.url.toString(), Parser.xmlParser())
|
return Jsoup.parse(response.body.string(), response.request.url.toString(), Parser.xmlParser())
|
||||||
|
|
Loading…
Reference in New Issue