mangaalarab update (#8550)
add genres,manga type,manga status and alternative names to manga Details
This commit is contained in:
parent
aa2b301ac1
commit
7ea52804f1
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'مانجا العرب'
|
extName = 'مانجا العرب'
|
||||||
pkgNameSuffix = 'ar.mangaalarab'
|
pkgNameSuffix = 'ar.mangaalarab'
|
||||||
extClass = '.MangaAlarab'
|
extClass = '.MangaAlarab'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,30 @@ class MangaAlarab : ParsedHttpSource() {
|
||||||
override fun mangaDetailsParse(document: Document): SManga {
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
return SManga.create().apply {
|
return SManga.create().apply {
|
||||||
document.select("article").first().let { info ->
|
document.select("article").first().let { info ->
|
||||||
|
|
||||||
description = info.select("p.text-sm").text()
|
description = info.select("p.text-sm").text()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add series type(manga/manhwa/manhua/other) thinggy to genre
|
||||||
|
genre = document.select("div.text-gray-600 a, div.container > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > span:nth-child(2)").joinToString(", ") { it.text() }
|
||||||
|
|
||||||
|
// add series Status to manga description
|
||||||
|
document.select("div.container > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(6) > span:nth-child(2)")?.first()?.text()?.also { statusText ->
|
||||||
|
when {
|
||||||
|
statusText.contains("مستمرة", true) -> status = SManga.ONGOING
|
||||||
|
statusText.contains("مكتملة", true) -> status = SManga.COMPLETED
|
||||||
|
else -> status = SManga.UNKNOWN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add alternative name to manga description
|
||||||
|
document.select("article span").text()?.let {
|
||||||
|
if (it.isEmpty().not()) {
|
||||||
|
description += when {
|
||||||
|
description!!.isEmpty() -> "Alternative Name: $it"
|
||||||
|
else -> "\n\nAlternativ Name: $it"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue