Allow partially loading extensions with individually marked NSFW sources

This commit is contained in:
arkon
2020-08-08 18:17:42 -04:00
parent abaca6e676
commit 421dfb4a2d
8 changed files with 55 additions and 13 deletions

View File

@@ -117,7 +117,7 @@ object PreferenceKeys {
const val automaticExtUpdates = "automatic_ext_updates"
const val allowNsfwSources = "allow_nsfw_sources"
const val allowNsfwSource = "allow_nsfw_source"
const val startScreen = "start_screen"

View File

@@ -37,4 +37,10 @@ object PreferenceValues {
VERTICAL,
BOTH
}
enum class NsfwAllowance {
ALLOWED,
PARTIAL,
BLOCKED
}
}

View File

@@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys
import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values
import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode
import eu.kanade.tachiyomi.data.preference.PreferenceValues.NsfwAllowance
import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.anilist.Anilist
import java.io.File
@@ -217,7 +218,7 @@ class PreferencesHelper(val context: Context) {
fun automaticExtUpdates() = flowPrefs.getBoolean(Keys.automaticExtUpdates, true)
fun allowNsfwSources() = prefs.getBoolean(Keys.allowNsfwSources, true)
fun allowNsfwSource() = flowPrefs.getEnum(Keys.allowNsfwSource, NsfwAllowance.ALLOWED)
fun extensionUpdatesCount() = flowPrefs.getInt("ext_updates_count", 0)