MangaThemesia: Status check (#1724)

use "Contains" like before
This commit is contained in:
Luqman 2024-03-06 19:55:22 +07:00 committed by GitHub
parent 5139f2cf51
commit 858366cf71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 19 deletions

View File

@ -2,7 +2,7 @@ plugins {
id("lib-multisrc") id("lib-multisrc")
} }
baseVersionCode = 29 baseVersionCode = 30
dependencies { dependencies {
api(project(":lib:i18n")) api(project(":lib:i18n"))

View File

@ -272,29 +272,30 @@ abstract class MangaThemesia(
return if (this.isNullOrBlank() || this == "-" || this == "N/A" || this == "n/a") null else this return if (this.isNullOrBlank() || this == "-" || this == "N/A" || this == "n/a") null else this
} }
open fun String?.parseStatus(): Int { open fun String?.parseStatus(): Int = when {
if (this == null) return SManga.UNKNOWN this == null -> SManga.UNKNOWN
return when (this.lowercase().trim()) { listOf(
"مستمرة", "en curso", "ongoing", "on going", "ativo", "en cours", "مستمرة", "en curso", "ongoing", "on going", "ativo", "en cours", "en cours de publication",
"en cours de publication", "đang tiến hành", "em lançamento", "онгоінг", "publishing", "đang tiến hành", "em lançamento", "онгоінг", "publishing", "devam ediyor", "em andamento",
"devam ediyor", "em andamento", "in corso", "güncel", "berjalan", "продолжается", "updating", "lançando", "in arrivo", "emision", "in corso", "güncel", "berjalan", "продолжается", "updating", "lançando", "in arrivo",
"en emision", "مستمر", "curso", "en marcha", "publicandose", "publicando", "连载中", "devam etmekte", "連載中", "emision", "en emision", "مستمر", "curso", "en marcha", "publicandose", "publicando",
-> SManga.ONGOING "连载中", "devam etmekte", "連載中",
).any { this.contains(it, ignoreCase = true) } -> SManga.ONGOING
"completed", "completo", "complété", "fini", "achevé", "terminé", "tamamlandı", "đã hoàn thành", "hoàn thành", listOf(
"مكتملة", "завершено", "finished", "finalizado", "completata", "one-shot", "bitti", "tamat", "completado", "concluído", "完結", "completed", "completo", "complété", "fini", "achevé", "terminé", "tamamlandı", "đã hoàn thành",
"concluido", "已完结", "bitmiş", "hoàn thành", "مكتملة", "завершено", "finished", "finalizado", "completata", "one-shot",
-> SManga.COMPLETED "bitti", "tamat", "completado", "concluído", "完結", "concluido", "已完结", "bitmiş",
).any { this.contains(it, ignoreCase = true) } -> SManga.COMPLETED
"canceled", "cancelled", "cancelado", "cancellato", "cancelados", "dropped", "discontinued", "abandonné", listOf("canceled", "cancelled", "cancelado", "cancellato", "cancelados", "dropped", "discontinued", "abandonné")
-> SManga.CANCELLED .any { this.contains(it, ignoreCase = true) } -> SManga.CANCELLED
"hiatus", "on hold", "pausado", "en espera", "en pause", "en attente", listOf("hiatus", "on hold", "pausado", "en espera", "en pause", "en attente")
-> SManga.ON_HIATUS .any { this.contains(it, ignoreCase = true) } -> SManga.ON_HIATUS
else -> SManga.UNKNOWN else -> SManga.UNKNOWN
}
} }
// Chapter list // Chapter list