From 531e1c62bb8ba62f3fe84efce60210b5b5560368 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 2 Jun 2023 18:23:31 -0400 Subject: [PATCH] Hide release period update restriction in non-dev builds until ready --- .../settings/screen/SettingsLibraryScreen.kt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt index f6f454fbb..7b31e9479 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt @@ -41,6 +41,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.ui.category.CategoryScreen +import eu.kanade.tachiyomi.util.system.isDevFlavor import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import tachiyomi.domain.category.interactor.GetCategories @@ -240,15 +241,18 @@ object SettingsLibraryScreen : SearchableSettings { title = stringResource(R.string.pref_library_update_refresh_trackers), subtitle = stringResource(R.string.pref_library_update_refresh_trackers_summary), ), + // TODO: remove isDevFlavor checks once functionality is available Preference.PreferenceItem.MultiSelectListPreference( pref = libraryUpdateMangaRestrictionPref, title = stringResource(R.string.pref_library_update_manga_restriction), - entries = mapOf( - MANGA_HAS_UNREAD to stringResource(R.string.pref_update_only_completely_read), - MANGA_NON_READ to stringResource(R.string.pref_update_only_started), - MANGA_NON_COMPLETED to stringResource(R.string.pref_update_only_non_completed), - MANGA_OUTSIDE_RELEASE_PERIOD to stringResource(R.string.pref_update_only_in_release_period), - ), + entries = buildMap { + put(MANGA_HAS_UNREAD, stringResource(R.string.pref_update_only_completely_read)) + put(MANGA_NON_READ, stringResource(R.string.pref_update_only_started)) + put(MANGA_NON_COMPLETED, stringResource(R.string.pref_update_only_non_completed)) + if (isDevFlavor) { + put(MANGA_OUTSIDE_RELEASE_PERIOD, stringResource(R.string.pref_update_only_in_release_period)) + } + }, ), Preference.PreferenceItem.TextPreference( title = stringResource(R.string.pref_update_release_grace_period), @@ -257,10 +261,10 @@ object SettingsLibraryScreen : SearchableSettings { pluralStringResource(R.plurals.pref_update_release_following_days, followRange, followRange), ).joinToString(), onClick = { showFetchRangesDialog = true }, - ).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction }, + ).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction && isDevFlavor }, Preference.PreferenceItem.InfoPreference( title = stringResource(R.string.pref_update_release_grace_period_info), - ).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction }, + ).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction && isDevFlavor }, ), ) }