Hide release period update restriction in non-dev builds until ready

(cherry picked from commit 531e1c62bb8ba62f3fe84efce60210b5b5560368)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsLibraryScreen.kt
This commit is contained in:
arkon 2023-06-02 18:23:31 -04:00 committed by Jobobby04
parent b42f1f2df8
commit b0b02e24c5

View File

@ -42,6 +42,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.ui.category.CategoryScreen import eu.kanade.tachiyomi.ui.category.CategoryScreen
import eu.kanade.tachiyomi.ui.category.genre.SortTagScreen import eu.kanade.tachiyomi.ui.category.genre.SortTagScreen
import eu.kanade.tachiyomi.util.system.isDevFlavor
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import tachiyomi.domain.UnsortedPreferences import tachiyomi.domain.UnsortedPreferences
@ -261,15 +262,18 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_library_update_refresh_trackers), title = stringResource(R.string.pref_library_update_refresh_trackers),
subtitle = stringResource(R.string.pref_library_update_refresh_trackers_summary), subtitle = stringResource(R.string.pref_library_update_refresh_trackers_summary),
), ),
// TODO: remove isDevFlavor checks once functionality is available
Preference.PreferenceItem.MultiSelectListPreference( Preference.PreferenceItem.MultiSelectListPreference(
pref = libraryUpdateMangaRestrictionPref, pref = libraryUpdateMangaRestrictionPref,
title = stringResource(R.string.pref_library_update_manga_restriction), title = stringResource(R.string.pref_library_update_manga_restriction),
entries = mapOf( entries = buildMap {
MANGA_HAS_UNREAD to stringResource(R.string.pref_update_only_completely_read), put(MANGA_HAS_UNREAD, stringResource(R.string.pref_update_only_completely_read))
MANGA_NON_READ to stringResource(R.string.pref_update_only_started), put(MANGA_NON_READ, stringResource(R.string.pref_update_only_started))
MANGA_NON_COMPLETED to stringResource(R.string.pref_update_only_non_completed), put(MANGA_NON_COMPLETED, stringResource(R.string.pref_update_only_non_completed))
MANGA_OUTSIDE_RELEASE_PERIOD to stringResource(R.string.pref_update_only_in_release_period), if (isDevFlavor) {
), put(MANGA_OUTSIDE_RELEASE_PERIOD, stringResource(R.string.pref_update_only_in_release_period))
}
},
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_update_release_grace_period), title = stringResource(R.string.pref_update_release_grace_period),
@ -278,10 +282,10 @@ object SettingsLibraryScreen : SearchableSettings {
pluralStringResource(R.plurals.pref_update_release_following_days, followRange, followRange), pluralStringResource(R.plurals.pref_update_release_following_days, followRange, followRange),
).joinToString(), ).joinToString(),
onClick = { showFetchRangesDialog = true }, onClick = { showFetchRangesDialog = true },
).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction }, ).takeIf { MANGA_OUTSIDE_RELEASE_PERIOD in libraryUpdateMangaRestriction && isDevFlavor },
Preference.PreferenceItem.InfoPreference( Preference.PreferenceItem.InfoPreference(
title = stringResource(R.string.pref_update_release_grace_period_info), 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 },
), ),
) )
} }