mangaalarab update (#8550)

add genres,manga type,manga status and alternative names to manga Details
This commit is contained in:
Ahmed gamal 2021-08-14 11:45:48 +02:00 committed by GitHub
parent aa2b301ac1
commit 7ea52804f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'مانجا العرب'
pkgNameSuffix = 'ar.mangaalarab'
extClass = '.MangaAlarab'
extVersionCode = 2
extVersionCode = 3
libVersion = '1.2'
}

View File

@ -90,9 +90,30 @@ class MangaAlarab : ParsedHttpSource() {
override fun mangaDetailsParse(document: Document): SManga {
return SManga.create().apply {
document.select("article").first().let { info ->
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"
}
}
}
}
}