Background tracker update during Library update (#5166)

* add preference to auto update trackers during library update

* also update trackers when updating chapters and preference is set

* remove unnecessary launch/join

* perform tracking update within the same chapter update loop to avoid double notifications
This commit is contained in:
Gauthier
2021-05-25 10:26:41 +08:00
committed by GitHub
parent 3d89a317c1
commit e76e903060
5 changed files with 41 additions and 19 deletions
@@ -168,6 +168,8 @@ object PreferenceKeys {
const val autoUpdateMetadata = "auto_update_metadata"
const val autoUpdateTrackers = "auto_update_trackers"
const val showLibraryUpdateErrors = "show_library_update_errors"
const val downloadNew = "download_new"
@@ -79,6 +79,8 @@ class PreferencesHelper(val context: Context) {
fun autoUpdateMetadata() = prefs.getBoolean(Keys.autoUpdateMetadata, false)
fun autoUpdateTrackers() = prefs.getBoolean(Keys.autoUpdateTrackers, false)
fun showLibraryUpdateErrors() = prefs.getBoolean(Keys.showLibraryUpdateErrors, false)
fun clear() = prefs.edit { clear() }