This commit is contained in:
Jobobby04 2021-03-10 17:20:42 -05:00
parent 42d49b7cba
commit 04200bb590
6 changed files with 15 additions and 28 deletions

View File

@ -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 <--

View File

@ -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 <--

View File

@ -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()

View File

@ -216,13 +216,9 @@ 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
}
}
// SY -->
preferences.extensionUpdatesCount()

View File

@ -276,20 +276,12 @@ 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
}
} 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
}
}
true
}
}

View File

@ -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
)
}