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 return pkgName in BlacklistedSources.BLACKLISTED_EXTENSIONS && blacklistEnabled
} }
// EXH <-- // EXH <--

View File

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

View File

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

View File

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

View File

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

View File

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