From 9f6f67c67656ec94b62e43534215dffb5926aafb Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Sun, 28 Aug 2022 03:38:06 +0800 Subject: [PATCH] Junmeitu: remove broken mirror (#13231) --- src/all/junmeitu/build.gradle | 2 +- .../extension/all/junmeitu/Junmeitu.kt | 39 ++----------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/all/junmeitu/build.gradle b/src/all/junmeitu/build.gradle index ad8f4c106..4875504cb 100644 --- a/src/all/junmeitu/build.gradle +++ b/src/all/junmeitu/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Junmeitu' pkgNameSuffix = 'all.junmeitu' extClass = '.Junmeitu' - extVersionCode = 3 + extVersionCode = 4 isNsfw = true } diff --git a/src/all/junmeitu/src/eu/kanade/tachiyomi/extension/all/junmeitu/Junmeitu.kt b/src/all/junmeitu/src/eu/kanade/tachiyomi/extension/all/junmeitu/Junmeitu.kt index e94be9638..dfd6d9f33 100644 --- a/src/all/junmeitu/src/eu/kanade/tachiyomi/extension/all/junmeitu/Junmeitu.kt +++ b/src/all/junmeitu/src/eu/kanade/tachiyomi/extension/all/junmeitu/Junmeitu.kt @@ -1,11 +1,6 @@ package eu.kanade.tachiyomi.extension.all.junmeitu -import android.app.Application -import android.content.SharedPreferences -import androidx.preference.ListPreference -import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.network.GET -import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page @@ -20,11 +15,9 @@ import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.nodes.Element import org.jsoup.select.Evaluator -import uy.kohesive.injekt.Injekt -import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy -class Junmeitu : ConfigurableSource, ParsedHttpSource() { +class Junmeitu : ParsedHttpSource() { override val lang = "all" override val name = "Junmeitu" override val supportsLatest = true @@ -32,34 +25,8 @@ class Junmeitu : ConfigurableSource, ParsedHttpSource() { private val json: Json by injectLazy() - // Preference - private val preferences: SharedPreferences by lazy { - Injekt.get().getSharedPreferences("source_$id", 0x0000) - } - - override val baseUrl: String = getMirrorPref()!! - - override fun setupPreferenceScreen(screen: PreferenceScreen) { - val mirrorPref = ListPreference(screen.context).apply { - key = "${MIRROR_PREF_KEY}_$lang" - title = MIRROR_PREF_TITLE - entries = MIRROR_PREF_ENTRIES - entryValues = MIRROR_PREF_ENTRY_VALUES - setDefaultValue(MIRROR_PREF_DEFAULT_VALUE) - summary = "%s" - } - screen.addPreference(mirrorPref) - } - - private fun getMirrorPref(): String? = preferences.getString("${MIRROR_PREF_KEY}_$lang", MIRROR_PREF_DEFAULT_VALUE) - - companion object { - private const val MIRROR_PREF_KEY = "MIRROR" - private const val MIRROR_PREF_TITLE = "Mirror" - private val MIRROR_PREF_ENTRIES = arrayOf("Junmeitu.com", "Meijuntu.com") - private val MIRROR_PREF_ENTRY_VALUES = arrayOf("https://junmeitu.com", "https://meijuntu.com") - private val MIRROR_PREF_DEFAULT_VALUE = MIRROR_PREF_ENTRY_VALUES[0] - } + // old pref ["MIRROR_all" => arrayOf("https://junmeitu.com", "https://meijuntu.com")] + override val baseUrl = "https://junmeitu.com" // Latest override fun latestUpdatesFromElement(element: Element): SManga {