Add reindex downloads description

Closes #8546
Also disable sound for the notification and cancel running indexing job if invalidating.
This commit is contained in:
arkon 2022-11-20 14:29:56 -05:00
parent e22896a956
commit 2d86f69caa
4 changed files with 51 additions and 50 deletions

View file

@ -191,6 +191,7 @@ class SettingsAdvancedScreen : SearchableSettings {
),
Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_invalidate_download_cache),
subtitle = stringResource(R.string.pref_invalidate_download_cache_summary),
onClick = { Injekt.get<DownloadCache>().invalidateCache() },
),
Preference.PreferenceItem.TextPreference(

View file

@ -222,6 +222,7 @@ class DownloadCache(
fun invalidateCache() {
lastRenew = 0L
renewalJob?.cancel()
}
/**
@ -242,7 +243,6 @@ class DownloadCache(
}
renewalJob = scope.launchIO {
try {
notifier.onCacheProgress()
var sources = getSources()
@ -302,10 +302,8 @@ class DownloadCache(
lastRenew = System.currentTimeMillis()
notifyChanges()
} finally {
notifier.dismissCacheProgress()
}
}
renewalJob?.invokeOnCompletion { notifier.dismissCacheProgress() }
}
private fun getSources(): List<Source> {

View file

@ -159,6 +159,7 @@ object Notifications {
setName(context.getString(R.string.channel_downloader_cache))
setGroup(GROUP_DOWNLOADER)
setShowBadge(false)
setSound(null, null)
},
buildNotificationChannel(CHANNEL_BACKUP_RESTORE_PROGRESS, IMPORTANCE_LOW) {
setName(context.getString(R.string.channel_progress))

View file

@ -505,6 +505,7 @@
<string name="cache_delete_error">Error occurred while clearing</string>
<string name="pref_auto_clear_chapter_cache">Clear chapter cache on app close</string>
<string name="pref_invalidate_download_cache">Invalidate downloads index</string>
<string name="pref_invalidate_download_cache_summary">Force app to recheck downloaded chapters</string>
<string name="pref_clear_database">Clear database</string>
<string name="pref_clear_database_summary">Delete history for entries that are not saved in your library</string>
<string name="clear_database_source_item_count">%1$d non-library entries in database</string>