Fix H@H setting so that its in line with the new version of E-Hentai

This commit is contained in:
Jobobby04
2020-06-05 15:19:08 -04:00
parent c7673f7b4b
commit bf4988ddc3
4 changed files with 29 additions and 11 deletions
@@ -252,4 +252,6 @@ object PreferenceKeys {
const val eh_enabled_categories = "eh_enabled_categories"
const val eh_ehentai_quality = "ehentai_quality"
const val eh_enable_hah = "eh_enable_hah"
}
@@ -270,7 +270,7 @@ class PreferencesHelper(val context: Context) {
fun imageQuality() = flowPrefs.getString(Keys.eh_ehentai_quality, "auto")
fun useHentaiAtHome() = flowPrefs.getBoolean("enable_hah", true)
fun useHentaiAtHome() = flowPrefs.getInt(Keys.eh_enable_hah, 0)
fun useJapaneseTitle() = flowPrefs.getBoolean("use_jp_title", false)
@@ -177,11 +177,26 @@ class SettingsEhController : SettingsController() {
}
}
switchPreference {
intListPreference {
title = "Use Hentai@Home Network"
summary = "Do you wish to load images through the Hentai@Home Network? Disabling this option will reduce the amount of pages you are able to view"
key = "enable_hah"
defaultValue = true
key = PreferenceKeys.eh_enable_hah
if (preferences.eh_hathPerksCookies().get().isBlank()) {
summary = "Do you wish to load images through the Hentai@Home Network, if available? Disabling this option will reduce the amount of pages you are able to view\nOptions:\n - Any client (Recommended)\n - Default port clients only (Can be slower. Enable if behind firewall/proxy that blocks outgoing non-standard ports.)"
entries = arrayOf(
"Any client (Recommended)",
"Default port clients only"
)
entryValues = arrayOf("0", "1")
} else {
summary = "Do you wish to load images through the Hentai@Home Network, if available? Disabling this option will reduce the amount of pages you are able to view\nOptions:\n - Any client (Recommended)\n - Default port clients only (Can be slower. Enable if behind firewall/proxy that blocks outgoing non-standard ports.)\n - No (Donator only. You will not be able to browse as many pages, enable only if having severe problems.)"
entries = arrayOf(
"Any client (Recommended)",
"Default port clients only",
"No(will select Default port clients only if you are not a donator)"
)
entryValues = arrayOf("0", "1", "2")
}
onChange { preferences.useHentaiAtHome().reconfigure() }
}.dependency = PreferenceKeys.eh_enableExHentai