From f47efdf9efe43a31126a07245b0f406f9b9f5227 Mon Sep 17 00:00:00 2001 From: qtcomput3 <81503114+qtcomput3@users.noreply.github.com> Date: Sat, 12 Feb 2022 06:09:58 -0600 Subject: [PATCH] Magical Translators: add Spanish language (#10800) --- .../guya/magicaltranslators/src/MagicalTranslators.kt | 9 ++++++++- .../eu/kanade/tachiyomi/multisrc/guya/GuyaGenerator.kt | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/multisrc/overrides/guya/magicaltranslators/src/MagicalTranslators.kt b/multisrc/overrides/guya/magicaltranslators/src/MagicalTranslators.kt index 5e1956133..f5b63435c 100644 --- a/multisrc/overrides/guya/magicaltranslators/src/MagicalTranslators.kt +++ b/multisrc/overrides/guya/magicaltranslators/src/MagicalTranslators.kt @@ -8,6 +8,7 @@ import okhttp3.Response class MagicalTranslatorsFactory : SourceFactory { override fun createSources() = listOf( MagicalTranslatorsEN(), + MagicalTranslatorsES(), MagicalTranslatorsPL(), ) } @@ -35,7 +36,13 @@ abstract class MagicalTranslatorsCommon(lang: String) : class MagicalTranslatorsEN : MagicalTranslatorsCommon("en") { override fun filterMangasPage(mangasPage: MangasPage): MangasPage = mangasPage.copy( - mangas = mangasPage.mangas.filterNot { it.url.endsWith("-PL") } + mangas = mangasPage.mangas.filterNot { it.url.endsWith("-ES") || it.url.endsWith("-PL") } + ) +} + +class MagicalTranslatorsES : MagicalTranslatorsCommon("es") { + override fun filterMangasPage(mangasPage: MangasPage): MangasPage = mangasPage.copy( + mangas = mangasPage.mangas.filter { it.url.endsWith("-ES") } ) } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/GuyaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/GuyaGenerator.kt index f9553f60f..0a0c5aeaf 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/GuyaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/guya/GuyaGenerator.kt @@ -16,7 +16,8 @@ class GuyaGenerator : ThemeSourceGenerator { SingleLang("Guya", "https://guya.moe", "en", overrideVersionCode = 18), SingleLang("Danke fürs Lesen", "https://danke.moe", "en", className = "DankeFursLesen"), SingleLang("Hachirumi", "https://hachirumi.com", "en", isNsfw = true), - MultiLang("Magical Translators", "https://mahoushoujobu.com", listOf("en", "pl")), + MultiLang("Magical Translators", "https://mahoushoujobu.com", listOf("en", "es", "pl"), + overrideVersionCode = 1), ) companion object { @JvmStatic