From 2f192f4c4d63869697add5dff92308b09c5e1580 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sat, 8 May 2021 16:12:49 -0400 Subject: [PATCH] Remove option to disabled auto checks for updates --- .../java/eu/kanade/tachiyomi/Migrations.kt | 12 +++++++--- .../data/preference/PreferenceKeys.kt | 2 -- .../data/preference/PreferencesHelper.kt | 2 -- .../ui/setting/SettingsGeneralController.kt | 22 ------------------- app/src/main/res/values/strings.xml | 1 - 5 files changed, 9 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index e4c09c7e04..0c1f19e2ab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -33,7 +33,7 @@ object Migrations { preferences.lastVersionCode().set(BuildConfig.VERSION_CODE) if (oldVersion == 0) { - if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) { + if (BuildConfig.INCLUDE_UPDATER) { UpdaterJob.setupTask() } ExtensionUpdateJob.setupTask() @@ -43,7 +43,7 @@ object Migrations { if (oldVersion < 14) { // Restore jobs after upgrading to evernote's job scheduler. - if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) { + if (BuildConfig.INCLUDE_UPDATER) { UpdaterJob.setupTask() } LibraryUpdateJob.setupTask() @@ -80,7 +80,7 @@ object Migrations { if (oldVersion < 62) { LibraryPresenter.updateDB() // Restore jobs after migrating from Evernote's job scheduler to WorkManager. - if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) { + if (BuildConfig.INCLUDE_UPDATER) { UpdaterJob.setupTask() } LibraryUpdateJob.setupTask() @@ -115,6 +115,12 @@ object Migrations { // Reset rotation to Free after replacing Lock preferences.rotation().set(1) } + if (oldVersion < 74) { + // Turn on auto updates for all users + if (BuildConfig.INCLUDE_UPDATER) { + UpdaterJob.setupTask() + } + } return true } return false diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt index c83ebec7f1..67e751ccf8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt @@ -140,8 +140,6 @@ object PreferenceKeys { const val librarySortingMode = "library_sorting_mode" - const val automaticUpdates = "automatic_updates" - const val automaticExtUpdates = "automatic_ext_updates" const val autoHideHopper = "autohide_hopper" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 64b7283e3d..95f519d598 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -280,8 +280,6 @@ class PreferencesHelper(val context: Context) { fun librarySortingAscending() = rxPrefs.getBoolean("library_sorting_ascending", true) - fun automaticUpdates() = prefs.getBoolean(Keys.automaticUpdates, true) - fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, true) fun collapsedCategories() = rxPrefs.getStringSet("collapsed_categories", mutableSetOf()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index 8084a9e152..abfd9e9c34 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -7,7 +7,6 @@ import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.asImmediateFlow -import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.appDelegateNightMode import eu.kanade.tachiyomi.util.system.getPrefTheme @@ -84,27 +83,6 @@ class SettingsGeneralController : SettingsController() { defaultValue = true } - switchPreference { - key = Keys.automaticUpdates - titleRes = R.string.check_for_updates - summaryRes = R.string.auto_check_for_app_versions - defaultValue = true - - if (isUpdaterEnabled) { - onChange { newValue -> - val checked = newValue as Boolean - if (checked) { - UpdaterJob.setupTask() - } else { - UpdaterJob.cancelTask() - } - true - } - } else { - isVisible = false - } - } - preferenceCategory { titleRes = R.string.display diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a13f11acb5..36c4f5bcf3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -608,7 +608,6 @@ Date format Check for updates Updated to v%1$s - Automatically check for new app versions Secure screen Auto-hide bottom navigation App shortcuts