From 618aba4fa871aec6a763d9410f0e0cdb8f3dded7 Mon Sep 17 00:00:00 2001 From: scb261 <65343233+scb261@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:39:31 +0200 Subject: [PATCH] Dragon Ball Multiverse: fix languages (#6024) * Dragon Ball Multiverse: fix languages * Forgot to remove a comment --- src/all/dragonball_multiverse/build.gradle | 2 +- .../all/dragonball_multiverse/DbMFactory.kt | 70 +++++++++---------- .../all/dragonball_multiverse/DbMultiverse.kt | 8 ++- .../dragonball_multiverse/DbMultiverseEN.kt | 2 +- 4 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/all/dragonball_multiverse/build.gradle b/src/all/dragonball_multiverse/build.gradle index bfe8ad2b6..b2dc0e724 100644 --- a/src/all/dragonball_multiverse/build.gradle +++ b/src/all/dragonball_multiverse/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Dragon Ball Multiverse' pkgNameSuffix = 'all.dragonball_multiverse' extClass = '.DbMFactory' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } diff --git a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMFactory.kt b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMFactory.kt index ab1b42a97..cde0b0b2f 100644 --- a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMFactory.kt +++ b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMFactory.kt @@ -46,38 +46,38 @@ class DbMFactory : SourceFactory { ) } -class DbMultiverseFR : DbMultiverse("fr") -class DbMultiverseJP : DbMultiverse("jp") -class DbMultiverseCN : DbMultiverse("cn") -class DbMultiverseES : DbMultiverse("es") -class DbMultiverseIT : DbMultiverse("it") -class DbMultiversePT : DbMultiverse("pt") -class DbMultiverseDE : DbMultiverse("de") -class DbMultiversePL : DbMultiverse("pl") -class DbMultiverseNL : DbMultiverse("nl") -class DbMultiverseFR_PA : DbMultiverse("fr-PA") -class DbMultiverseTR_TR : DbMultiverse("tr-TR") -class DbMultiversePT_BR : DbMultiverse("pt-BR") -class DbMultiverseHU_HU : DbMultiverse("hu-HU") -class DbMultiverseGA_ES : DbMultiverse("ga-ES") -class DbMultiverseCT_CT : DbMultiverse("ct-CT") -class DbMultiverseNO_NO : DbMultiverse("no-NO") -class DbMultiverseRU_RU : DbMultiverse("ru-RU") -class DbMultiverseRO_RO : DbMultiverse("ro-RO") -class DbMultiverseEU_EH : DbMultiverse("eu-EH") -class DbMultiverseLT_LT : DbMultiverse("lt-LT") -class DbMultiverseHR_HR : DbMultiverse("hr-HR") -class DbMultiverseKR_KR : DbMultiverse("kr-KR") -class DbMultiverseFI_FI : DbMultiverse("fi-FI") -class DbMultiverseHE_HE : DbMultiverse("he-HE") -class DbMultiverseBG_BG : DbMultiverse("bg-BG") -class DbMultiverseSV_SE : DbMultiverse("sv-SE") -class DbMultiverseGR_GR : DbMultiverse("gr-GR") -class DbMultiverseES_CO : DbMultiverse("es-CO") -class DbMultiverseAR_JO : DbMultiverse("ar-JO") -class DbMultiverseTL_PI : DbMultiverse("tl-PI") -class DbMultiverseLA_LA : DbMultiverse("la-LA") -class DbMultiverseDA_DK : DbMultiverse("da-DK") -class DbMultiverseCO_FR : DbMultiverse("co-FR") -class DbMultiverseBR_FR : DbMultiverse("br-FR") -class DbMultiverseXX_VE : DbMultiverse("xx-VE") +class DbMultiverseFR : DbMultiverse("fr", "fr") +class DbMultiverseJP : DbMultiverse("ja", "jp") +class DbMultiverseCN : DbMultiverse("zh", "cn") +class DbMultiverseES : DbMultiverse("es", "es") +class DbMultiverseIT : DbMultiverse("it", "it") +class DbMultiversePT : DbMultiverse("pt", "pt") +class DbMultiverseDE : DbMultiverse("de", "de") +class DbMultiversePL : DbMultiverse("pl", "pl") +class DbMultiverseNL : DbMultiverse("nl", "nl") +class DbMultiverseFR_PA : DbMultiverse("fr", "fr_PA") +class DbMultiverseTR_TR : DbMultiverse("tr", "tr_TR") +class DbMultiversePT_BR : DbMultiverse("pt-BR", "pt_BR") +class DbMultiverseHU_HU : DbMultiverse("hu", "hu_HU") +class DbMultiverseGA_ES : DbMultiverse("ga", "ga_ES") +class DbMultiverseCT_CT : DbMultiverse("ca", "ct_CT") +class DbMultiverseNO_NO : DbMultiverse("no", "no_NO") +class DbMultiverseRU_RU : DbMultiverse("ru", "ru_RU") +class DbMultiverseRO_RO : DbMultiverse("ro", "ro_RO") +class DbMultiverseEU_EH : DbMultiverse("eu", "eu_EH") +class DbMultiverseLT_LT : DbMultiverse("lt", "lt_LT") +class DbMultiverseHR_HR : DbMultiverse("hr", "hr_HR") +class DbMultiverseKR_KR : DbMultiverse("ko", "kr_KR") +class DbMultiverseFI_FI : DbMultiverse("fi", "fi_FI") +class DbMultiverseHE_HE : DbMultiverse("he", "he_HE") +class DbMultiverseBG_BG : DbMultiverse("bg", "bg_BG") +class DbMultiverseSV_SE : DbMultiverse("sv", "sv_SE") +class DbMultiverseGR_GR : DbMultiverse("el", "gr_GR") +class DbMultiverseES_CO : DbMultiverse("es-419", "es_CO") +class DbMultiverseAR_JO : DbMultiverse("ar", "ar_JO") +class DbMultiverseTL_PI : DbMultiverse("fil", "tl_PI") +class DbMultiverseLA_LA : DbMultiverse("la", "la_LA") +class DbMultiverseDA_DK : DbMultiverse("da", "da_DK") +class DbMultiverseCO_FR : DbMultiverse("co", "co_FR") +class DbMultiverseBR_FR : DbMultiverse("br", "br_FR") +class DbMultiverseXX_VE : DbMultiverse("vec", "xx_VE") diff --git a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMultiverse.kt b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMultiverse.kt index 3b5f43dce..eedf0186b 100644 --- a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMultiverse.kt +++ b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/all/dragonball_multiverse/DbMultiverse.kt @@ -13,9 +13,11 @@ import org.jsoup.nodes.Document import org.jsoup.nodes.Element import rx.Observable -abstract class DbMultiverse(override val lang: String) : ParsedHttpSource() { +abstract class DbMultiverse(override val lang: String, private val internalLang: String) : ParsedHttpSource() { - override val name = "Dragon Ball Multiverse" + override val name = + if (internalLang.endsWith("_PA")) "Dragon Ball Multiverse Parody" + else "Dragon Ball Multiverse" override val baseUrl = "https://www.dragonball-multiverse.com" override val supportsLatest = false @@ -64,7 +66,7 @@ abstract class DbMultiverse(override val lang: String) : ParsedHttpSource() { private fun createManga(document: Document?) = SManga.create().apply { title = name status = SManga.ONGOING - url = "/${lang.replace("-", "_")}/chapters.html" + url = "/$internalLang/chapters.html" description = "Dragon Ball Multiverse (DBM) is a free online comic, made by a whole team of fans. It's our personal sequel to DBZ." thumbnail_url = document?.select("div[ch=\"1\"] img")?.attr("abs:src") } diff --git a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/en/dragonball_multiverse/DbMultiverseEN.kt b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/en/dragonball_multiverse/DbMultiverseEN.kt index 12d216c33..75f623e45 100644 --- a/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/en/dragonball_multiverse/DbMultiverseEN.kt +++ b/src/all/dragonball_multiverse/src/eu/kanade/tachiyomi/extension/en/dragonball_multiverse/DbMultiverseEN.kt @@ -1,3 +1,3 @@ package eu.kanade.tachiyomi.extension.all.dragonball_multiverse -class DbMultiverseEN : DbMultiverse("en") +class DbMultiverseEN : DbMultiverse("en", "en")