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
|
return pkgName in BlacklistedSources.BLACKLISTED_EXTENSIONS && blacklistEnabled
|
||||||
}
|
}
|
||||||
// EXH <--
|
// EXH <--
|
||||||
|
@ -155,13 +155,12 @@ open class SourceManager(private val context: Context) {
|
|||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
private fun createEHSources(): List<Source> {
|
private fun createEHSources(): List<Source> {
|
||||||
val exSrcs = mutableListOf<HttpSource>(
|
val sources = listOf<HttpSource>(
|
||||||
EHentai(EH_SOURCE_ID, false, context)
|
EHentai(EH_SOURCE_ID, false, context)
|
||||||
)
|
)
|
||||||
if (prefs.enableExhentai().get()) {
|
return if (prefs.enableExhentai().get()) {
|
||||||
exSrcs += EHentai(EXH_SOURCE_ID, true, context)
|
sources + EHentai(EXH_SOURCE_ID, true, context)
|
||||||
}
|
} else sources
|
||||||
return exSrcs
|
|
||||||
}
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import com.bluelinelabs.conductor.changehandler.AnimatorChangeHandler
|
|||||||
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
|
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 {
|
class OneWayFadeChangeHandler : FadeChangeHandler {
|
||||||
constructor()
|
constructor()
|
||||||
|
@ -216,12 +216,8 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|||||||
}
|
}
|
||||||
// SY -->
|
// SY -->
|
||||||
if (!preferences.isHentaiEnabled().get()) {
|
if (!preferences.isHentaiEnabled().get()) {
|
||||||
if (EH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||||
}
|
|
||||||
if (EXH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
|
||||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// SY -->
|
// SY -->
|
||||||
|
|
||||||
|
@ -276,19 +276,11 @@ class SettingsAdvancedController : SettingsController() {
|
|||||||
|
|
||||||
onChange {
|
onChange {
|
||||||
if (preferences.isHentaiEnabled().get()) {
|
if (preferences.isHentaiEnabled().get()) {
|
||||||
if (EH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
||||||
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
|
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
||||||
}
|
|
||||||
if (EXH_SOURCE_ID !in BlacklistedSources.HIDDEN_SOURCES) {
|
|
||||||
BlacklistedSources.HIDDEN_SOURCES += EXH_SOURCE_ID
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (EH_SOURCE_ID in BlacklistedSources.HIDDEN_SOURCES) {
|
BlacklistedSources.HIDDEN_SOURCES -= EH_SOURCE_ID
|
||||||
BlacklistedSources.HIDDEN_SOURCES -= EH_SOURCE_ID
|
BlacklistedSources.HIDDEN_SOURCES -= EXH_SOURCE_ID
|
||||||
}
|
|
||||||
if (EXH_SOURCE_ID in BlacklistedSources.HIDDEN_SOURCES) {
|
|
||||||
BlacklistedSources.HIDDEN_SOURCES -= EXH_SOURCE_ID
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package exh.source
|
package exh.source
|
||||||
|
|
||||||
object BlacklistedSources {
|
object BlacklistedSources {
|
||||||
val EHENTAI_EXT_SOURCES = listOf(
|
val EHENTAI_EXT_SOURCES = longArrayOf(
|
||||||
8100626124886895451,
|
8100626124886895451,
|
||||||
57122881048805941,
|
57122881048805941,
|
||||||
4678440076103929247,
|
4678440076103929247,
|
||||||
@ -23,11 +23,11 @@ object BlacklistedSources {
|
|||||||
|
|
||||||
val BLACKLISTED_EXT_SOURCES = EHENTAI_EXT_SOURCES
|
val BLACKLISTED_EXT_SOURCES = EHENTAI_EXT_SOURCES
|
||||||
|
|
||||||
val BLACKLISTED_EXTENSIONS = listOf(
|
val BLACKLISTED_EXTENSIONS = arrayOf(
|
||||||
"eu.kanade.tachiyomi.extension.all.ehentai"
|
"eu.kanade.tachiyomi.extension.all.ehentai"
|
||||||
)
|
)
|
||||||
|
|
||||||
var HIDDEN_SOURCES = listOf(
|
var HIDDEN_SOURCES = setOf(
|
||||||
MERGED_SOURCE_ID
|
MERGED_SOURCE_ID
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user