Make library update error notification optional (closes #3200)
(cherry picked from commit 647391ef73ab0b89b1ba1f59e6e80d7605ba51e4)
This commit is contained in:
parent
1fb6b3775d
commit
b34a137c07
@ -313,7 +313,7 @@ class LibraryUpdateService(
|
||||
}
|
||||
}
|
||||
|
||||
if (failedUpdates.isNotEmpty()) {
|
||||
if (preferences.showLibraryUpdateErrors() && failedUpdates.isNotEmpty()) {
|
||||
val errorFile = writeErrorFile(failedUpdates)
|
||||
notifier.showUpdateErrorNotification(
|
||||
failedUpdates.map { it.first.title },
|
||||
|
@ -129,6 +129,8 @@ object PreferenceKeys {
|
||||
|
||||
const val hideNotificationContent = "hide_notification_content"
|
||||
|
||||
const val showLibraryUpdateErrors = "show_library_update_errors"
|
||||
|
||||
const val downloadNew = "download_new"
|
||||
|
||||
const val downloadNewCategories = "download_new_categories"
|
||||
|
@ -67,6 +67,8 @@ class PreferencesHelper(val context: Context) {
|
||||
|
||||
fun hideNotificationContent() = prefs.getBoolean(Keys.hideNotificationContent, false)
|
||||
|
||||
fun showLibraryUpdateErrors() = prefs.getBoolean(Keys.showLibraryUpdateErrors, false)
|
||||
|
||||
fun clear() = prefs.edit().clear().apply()
|
||||
|
||||
fun themeMode() = flowPrefs.getString(Keys.themeMode, Values.THEME_MODE_SYSTEM)
|
||||
|
@ -164,6 +164,11 @@ class SettingsLibraryController : SettingsController() {
|
||||
true
|
||||
}
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.showLibraryUpdateErrors
|
||||
titleRes = R.string.pref_library_update_error_notification
|
||||
defaultValue = false
|
||||
}
|
||||
}
|
||||
|
||||
preferenceCategory {
|
||||
|
@ -183,6 +183,7 @@
|
||||
<string name="wifi">Wi-Fi</string>
|
||||
<string name="charging">Charging</string>
|
||||
<string name="pref_update_only_non_completed">Only update ongoing manga</string>
|
||||
<string name="pref_library_update_error_notification">Show update errors notifications</string>
|
||||
|
||||
<string name="pref_category_library_categories">Categories</string>
|
||||
<string name="default_category">Default category</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user