From 858366cf71f2a03ca2aac97067d757b277f1ab88 Mon Sep 17 00:00:00 2001 From: Luqman <16263232+Riztard@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:55:22 +0700 Subject: [PATCH] MangaThemesia: Status check (#1724) use "Contains" like before --- lib-multisrc/mangathemesia/build.gradle.kts | 2 +- .../multisrc/mangathemesia/MangaThemesia.kt | 37 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib-multisrc/mangathemesia/build.gradle.kts b/lib-multisrc/mangathemesia/build.gradle.kts index 73f9e980b..e58bf4407 100644 --- a/lib-multisrc/mangathemesia/build.gradle.kts +++ b/lib-multisrc/mangathemesia/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("lib-multisrc") } -baseVersionCode = 29 +baseVersionCode = 30 dependencies { api(project(":lib:i18n")) diff --git a/lib-multisrc/mangathemesia/src/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt b/lib-multisrc/mangathemesia/src/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt index 2100a7941..f30575bf4 100644 --- a/lib-multisrc/mangathemesia/src/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt +++ b/lib-multisrc/mangathemesia/src/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesia.kt @@ -272,29 +272,30 @@ abstract class MangaThemesia( return if (this.isNullOrBlank() || this == "-" || this == "N/A" || this == "n/a") null else this } - open fun String?.parseStatus(): Int { - if (this == null) return SManga.UNKNOWN + open fun String?.parseStatus(): Int = when { + this == null -> SManga.UNKNOWN - return when (this.lowercase().trim()) { - "مستمرة", "en curso", "ongoing", "on going", "ativo", "en cours", - "en cours de publication", "đang tiến hành", "em lançamento", "онгоінг", "publishing", - "devam ediyor", "em andamento", "in corso", "güncel", "berjalan", "продолжается", "updating", "lançando", "in arrivo", "emision", - "en emision", "مستمر", "curso", "en marcha", "publicandose", "publicando", "连载中", "devam etmekte", "連載中", - -> SManga.ONGOING + listOf( + "مستمرة", "en curso", "ongoing", "on going", "ativo", "en cours", "en cours de publication", + "đang tiến hành", "em lançamento", "онгоінг", "publishing", "devam ediyor", "em andamento", + "in corso", "güncel", "berjalan", "продолжается", "updating", "lançando", "in arrivo", + "emision", "en emision", "مستمر", "curso", "en marcha", "publicandose", "publicando", + "连载中", "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", - "مكتملة", "завершено", "finished", "finalizado", "completata", "one-shot", "bitti", "tamat", "completado", "concluído", "完結", - "concluido", "已完结", "bitmiş", - -> SManga.COMPLETED + listOf( + "completed", "completo", "complété", "fini", "achevé", "terminé", "tamamlandı", "đã hoàn thành", + "hoàn thành", "مكتملة", "завершено", "finished", "finalizado", "completata", "one-shot", + "bitti", "tamat", "completado", "concluído", "完結", "concluido", "已完结", "bitmiş", + ).any { this.contains(it, ignoreCase = true) } -> SManga.COMPLETED - "canceled", "cancelled", "cancelado", "cancellato", "cancelados", "dropped", "discontinued", "abandonné", - -> SManga.CANCELLED + listOf("canceled", "cancelled", "cancelado", "cancellato", "cancelados", "dropped", "discontinued", "abandonné") + .any { this.contains(it, ignoreCase = true) } -> SManga.CANCELLED - "hiatus", "on hold", "pausado", "en espera", "en pause", "en attente", - -> SManga.ON_HIATUS + listOf("hiatus", "on hold", "pausado", "en espera", "en pause", "en attente") + .any { this.contains(it, ignoreCase = true) } -> SManga.ON_HIATUS - else -> SManga.UNKNOWN - } + else -> SManga.UNKNOWN } // Chapter list