Bato.to: fix auto mirror w/o restart, update mirror list (#11054)
* Bato.to: always call `getMirrorPref()` in `baseUrl` You no longer need to restart after changing to the 'auto' mirror. * Bato.to: update mirror list * Bato.to: bump version
This commit is contained in:
parent
3afb33fe4a
commit
039c241d33
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Bato.to'
|
extName = 'Bato.to'
|
||||||
extClass = '.BatoToFactory'
|
extClass = '.BatoToFactory'
|
||||||
extVersionCode = 54
|
extVersionCode = 55
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,18 +54,7 @@ open class BatoTo(
|
|||||||
|
|
||||||
override val name: String = "Bato.to"
|
override val name: String = "Bato.to"
|
||||||
|
|
||||||
override var baseUrl: String = ""
|
override val baseUrl: String get() = getMirrorPref()
|
||||||
get() {
|
|
||||||
val current = field
|
|
||||||
if (current.isNotEmpty()) {
|
|
||||||
return when (current) {
|
|
||||||
"Auto" -> getMirrorPref()
|
|
||||||
else -> current
|
|
||||||
}
|
|
||||||
}
|
|
||||||
field = getMirrorPref()
|
|
||||||
return field
|
|
||||||
}
|
|
||||||
|
|
||||||
override val id: Long = when (lang) {
|
override val id: Long = when (lang) {
|
||||||
"zh-Hans" -> 2818874445640189582
|
"zh-Hans" -> 2818874445640189582
|
||||||
@ -82,10 +71,6 @@ open class BatoTo(
|
|||||||
entryValues = MIRROR_PREF_ENTRY_VALUES
|
entryValues = MIRROR_PREF_ENTRY_VALUES
|
||||||
setDefaultValue(MIRROR_PREF_DEFAULT_VALUE)
|
setDefaultValue(MIRROR_PREF_DEFAULT_VALUE)
|
||||||
summary = "%s"
|
summary = "%s"
|
||||||
setOnPreferenceChangeListener { _, newValue ->
|
|
||||||
baseUrl = newValue as String
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
val altChapterListPref = CheckBoxPreference(screen.context).apply {
|
val altChapterListPref = CheckBoxPreference(screen.context).apply {
|
||||||
key = "${ALT_CHAPTER_LIST_PREF_KEY}_$lang"
|
key = "${ALT_CHAPTER_LIST_PREF_KEY}_$lang"
|
||||||
@ -1047,39 +1032,72 @@ open class BatoTo(
|
|||||||
private const val REMOVE_TITLE_VERSION_PREF = "REMOVE_TITLE_VERSION"
|
private const val REMOVE_TITLE_VERSION_PREF = "REMOVE_TITLE_VERSION"
|
||||||
private val MIRROR_PREF_ENTRIES = arrayOf(
|
private val MIRROR_PREF_ENTRIES = arrayOf(
|
||||||
"Auto",
|
"Auto",
|
||||||
"batocomic.com",
|
// https://batotomirrors.pages.dev/
|
||||||
"batocomic.net",
|
"ato.to",
|
||||||
"batocomic.org",
|
"dto.to",
|
||||||
|
"fto.to",
|
||||||
|
"hto.to",
|
||||||
|
"jto.to",
|
||||||
|
"lto.to",
|
||||||
|
"mto.to",
|
||||||
|
"nto.to",
|
||||||
|
"vto.to",
|
||||||
|
"wto.to",
|
||||||
|
"xto.to",
|
||||||
|
"yto.to",
|
||||||
|
"vba.to",
|
||||||
|
"wba.to",
|
||||||
|
"xba.to",
|
||||||
|
"yba.to",
|
||||||
|
"zba.to",
|
||||||
|
"bato.ac",
|
||||||
|
"bato.bz",
|
||||||
|
"bato.cc",
|
||||||
|
"bato.cx",
|
||||||
|
"bato.id",
|
||||||
|
"bato.pw",
|
||||||
|
"bato.sh",
|
||||||
|
"bato.to",
|
||||||
|
"bato.vc",
|
||||||
|
"bato.day",
|
||||||
|
"bato.red",
|
||||||
|
"bato.run",
|
||||||
|
"batoto.in",
|
||||||
|
"batoto.tv",
|
||||||
"batotoo.com",
|
"batotoo.com",
|
||||||
"batotwo.com",
|
"batotwo.com",
|
||||||
|
"batpub.com",
|
||||||
|
"batread.com",
|
||||||
"battwo.com",
|
"battwo.com",
|
||||||
"comiko.net",
|
|
||||||
"comiko.org",
|
|
||||||
"readtoto.com",
|
|
||||||
"readtoto.net",
|
|
||||||
"readtoto.org",
|
|
||||||
"xbato.com",
|
"xbato.com",
|
||||||
"xbato.net",
|
"xbato.net",
|
||||||
"xbato.org",
|
"xbato.org",
|
||||||
"zbato.com",
|
"zbato.com",
|
||||||
"zbato.net",
|
"zbato.net",
|
||||||
"zbato.org",
|
"zbato.org",
|
||||||
"dto.to",
|
"comiko.net",
|
||||||
"fto.to",
|
"comiko.org",
|
||||||
"hto.to",
|
"mangatoto.com",
|
||||||
"jto.to",
|
"mangatoto.net",
|
||||||
"mto.to",
|
"mangatoto.org",
|
||||||
"wto.to",
|
"batocomic.com",
|
||||||
|
"batocomic.net",
|
||||||
|
"batocomic.org",
|
||||||
|
"readtoto.com",
|
||||||
|
"readtoto.net",
|
||||||
|
"readtoto.org",
|
||||||
|
"kuku.to",
|
||||||
|
"okok.to",
|
||||||
|
"ruru.to",
|
||||||
|
"xdxd.to",
|
||||||
|
// "bato.si", // (v4)
|
||||||
|
// "bato.ing", // (v4)
|
||||||
)
|
)
|
||||||
private val MIRROR_PREF_ENTRY_VALUES = MIRROR_PREF_ENTRIES.map { "https://$it" }.toTypedArray()
|
private val MIRROR_PREF_ENTRY_VALUES = MIRROR_PREF_ENTRIES.map { "https://$it" }.toTypedArray()
|
||||||
private val MIRROR_PREF_DEFAULT_VALUE = MIRROR_PREF_ENTRY_VALUES[0]
|
private val MIRROR_PREF_DEFAULT_VALUE = MIRROR_PREF_ENTRY_VALUES[0]
|
||||||
|
|
||||||
private val DEPRECATED_MIRRORS = listOf(
|
private val DEPRECATED_MIRRORS = listOf(
|
||||||
"https://bato.to",
|
|
||||||
"https://batocc.com", // parked
|
"https://batocc.com", // parked
|
||||||
"https://mangatoto.com",
|
|
||||||
"https://mangatoto.net",
|
|
||||||
"https://mangatoto.org",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
private const val ALT_CHAPTER_LIST_PREF_KEY = "ALT_CHAPTER_LIST"
|
private const val ALT_CHAPTER_LIST_PREF_KEY = "ALT_CHAPTER_LIST"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user