Junmeitu: remove broken mirror (#13231)
This commit is contained in:
parent
6fae0d3f7a
commit
9f6f67c676
|
@ -6,7 +6,7 @@ ext {
|
||||||
extName = 'Junmeitu'
|
extName = 'Junmeitu'
|
||||||
pkgNameSuffix = 'all.junmeitu'
|
pkgNameSuffix = 'all.junmeitu'
|
||||||
extClass = '.Junmeitu'
|
extClass = '.Junmeitu'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.all.junmeitu
|
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.network.GET
|
||||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
|
@ -20,11 +15,9 @@ import org.jsoup.Jsoup
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import org.jsoup.select.Evaluator
|
import org.jsoup.select.Evaluator
|
||||||
import uy.kohesive.injekt.Injekt
|
|
||||||
import uy.kohesive.injekt.api.get
|
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
|
||||||
class Junmeitu : ConfigurableSource, ParsedHttpSource() {
|
class Junmeitu : ParsedHttpSource() {
|
||||||
override val lang = "all"
|
override val lang = "all"
|
||||||
override val name = "Junmeitu"
|
override val name = "Junmeitu"
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
@ -32,34 +25,8 @@ class Junmeitu : ConfigurableSource, ParsedHttpSource() {
|
||||||
|
|
||||||
private val json: Json by injectLazy()
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
// Preference
|
// old pref ["MIRROR_all" => arrayOf("https://junmeitu.com", "https://meijuntu.com")]
|
||||||
private val preferences: SharedPreferences by lazy {
|
override val baseUrl = "https://junmeitu.com"
|
||||||
Injekt.get<Application>().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]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Latest
|
// Latest
|
||||||
override fun latestUpdatesFromElement(element: Element): SManga {
|
override fun latestUpdatesFromElement(element: Element): SManga {
|
||||||
|
|
Loading…
Reference in New Issue