2019-08-05 03:27:59 +02:00
|
|
|
package exh.debug
|
|
|
|
|
|
|
|
|
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
2020-09-14 04:03:27 +02:00
|
|
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
2019-08-05 03:27:59 +02:00
|
|
|
import uy.kohesive.injekt.injectLazy
|
|
|
|
|
|
|
|
|
|
enum class DebugToggles(val default: Boolean) {
|
2019-08-13 06:04:02 +02:00
|
|
|
// Redirect to master version of gallery when encountering a gallery that has a parent/child that is already in the library
|
2019-08-05 03:27:59 +02:00
|
|
|
ENABLE_EXH_ROOT_REDIRECT(true),
|
2019-08-13 06:04:02 +02:00
|
|
|
// Enable debug overlay (only available in debug builds)
|
2019-08-05 03:27:59 +02:00
|
|
|
ENABLE_DEBUG_OVERLAY(true),
|
2019-08-13 06:04:02 +02:00
|
|
|
// Convert non-root galleries into root galleries when loading them
|
2019-08-05 04:55:38 +02:00
|
|
|
PULL_TO_ROOT_WHEN_LOADING_EXH_MANGA_DETAILS(true),
|
2019-08-13 06:04:02 +02:00
|
|
|
// Do not update the same gallery too often
|
|
|
|
|
RESTRICT_EXH_GALLERY_UPDATE_CHECK_FREQUENCY(true),
|
|
|
|
|
// Pretend that all galleries only have a single version
|
|
|
|
|
INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS(false);
|
2019-08-05 03:27:59 +02:00
|
|
|
|
|
|
|
|
val prefKey = "eh_debug_toggle_${name.toLowerCase()}"
|
|
|
|
|
|
2020-09-14 04:03:27 +02:00
|
|
|
@OptIn(ExperimentalCoroutinesApi::class)
|
2019-08-05 03:27:59 +02:00
|
|
|
var enabled: Boolean
|
2020-05-17 23:10:42 +02:00
|
|
|
get() = prefs.flowPrefs.getBoolean(prefKey, default).get()
|
2019-08-05 03:27:59 +02:00
|
|
|
set(value) {
|
2020-05-17 23:10:42 +02:00
|
|
|
prefs.flowPrefs.getBoolean(prefKey).set(value)
|
2019-08-05 03:27:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
|
private val prefs: PreferencesHelper by injectLazy()
|
|
|
|
|
}
|
2020-04-04 22:30:05 +02:00
|
|
|
}
|