Cleanup
This commit is contained in:
parent
42d49b7cba
commit
04200bb590
@ -164,7 +164,7 @@ class ExtensionManager(
|
||||
}
|
||||
}
|
||||
|
||||
fun Extension.isBlacklisted(blacklistEnabled: Boolean = preferences.enableSourceBlacklist().get()): Boolean {
|
||||
private fun Extension.isBlacklisted(blacklistEnabled: Boolean = preferences.enableSourceBlacklist().get()): Boolean {
|
||||
return pkgName in BlacklistedSources.BLACKLISTED_EXTENSIONS && blacklistEnabled
|
||||
}
|
||||
// EXH <--
|
||||
|
@ -155,13 +155,12 @@ open class SourceManager(private val context: Context) {
|
||||
|
||||
// SY -->
|
||||
private fun createEHSources(): List<Source> {
|
||||
val exSrcs = mutableListOf<HttpSource>(
|
||||
val sources = listOf<HttpSource>(
|
||||
EHentai(EH_SOURCE_ID, false, context)
|
||||
)
|
||||
if (prefs.enableExhentai().get()) {
|
||||
exSrcs += EHentai(EXH_SOURCE_ID, true, context)
|
||||
}
|
||||
return exSrcs
|
||||
return if (prefs.enableExhentai().get()) {
|
||||
sources + EHentai(EXH_SOURCE_ID, true, context)
|
||||
} else sources
|
||||
}
|
||||
// SY <--
|
||||
|
||||
|
@ -10,7 +10,7 @@ import com.bluelinelabs.conductor.changehandler.AnimatorChangeHandler
|
||||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
|
||||
|
||||
/**
|
||||
* An [AnimatorChangeHandler] that will cross fade two views
|
||||
* An [AnimatorChangeHandler] that will remove the from view and fade in the to view
|
||||
*/
|
||||
class OneWayFadeChangeHandler : FadeChangeHandler {
|
||||
constructor()
|
||||
|
@ -216,12 +216,8 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
||||
}
|
||||
// SY -->
|
||||
if (!preferences.isHentaiEnabled().get()) {
|
||||
if (EH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||
}
|
||||
if (EXH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||
}
|
||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||
}
|
||||
// SY -->
|
||||
|
||||
|
@ -276,19 +276,11 @@ class SettingsAdvancedController : SettingsController() {
|
||||
|
||||
onChange {
|
||||
if (preferences.isHentaiEnabled().get()) {
|
||||
if (EH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||
}
|
||||
if (EXH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||
}
|
||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||
} else {
|
||||
if (EH_SOURCE_ID in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES -= EH_SOURCE_ID
|
||||
}
|
||||
if (EXH_SOURCE_ID in BlacklistedSources.HIDDEN_SOURCES) {
|
||||
BlacklistedSources.HIDDEN_SOURCES -= EXH_SOURCE_ID
|
||||
}
|
||||
BlacklistedSources.HIDDEN_SOURCES -= EH_SOURCE_ID
|
||||
BlacklistedSources.HIDDEN_SOURCES -= EXH_SOURCE_ID
|
||||
}
|
||||
true
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package exh.source
|
||||
|
||||
object BlacklistedSources {
|
||||
val EHENTAI_EXT_SOURCES = listOf(
|
||||
val EHENTAI_EXT_SOURCES = longArrayOf(
|
||||
8100626124886895451,
|
||||
57122881048805941,
|
||||
4678440076103929247,
|
||||
@ -23,11 +23,11 @@ object BlacklistedSources {
|
||||
|
||||
val BLACKLISTED_EXT_SOURCES = EHENTAI_EXT_SOURCES
|
||||
|
||||
val BLACKLISTED_EXTENSIONS = listOf(
|
||||
val BLACKLISTED_EXTENSIONS = arrayOf(
|
||||
"eu.kanade.tachiyomi.extension.all.ehentai"
|
||||
)
|
||||
|
||||
var HIDDEN_SOURCES = listOf(
|
||||
var HIDDEN_SOURCES = setOf(
|
||||
MERGED_SOURCE_ID
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user