From 569df39fb88e534fa0deb5b9a412f84936006859 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 22 May 2021 11:52:28 -0400 Subject: [PATCH] Remove 1 or 2 hour library updates to avoid DDoSing sources --- app/build.gradle.kts | 2 +- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 8 ++++++++ .../tachiyomi/ui/setting/SettingsLibraryController.kt | 4 +--- app/src/main/res/values/strings.xml | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fdbc3ccb9..5a6d060c1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -29,7 +29,7 @@ android { minSdkVersion(AndroidConfig.minSdk) targetSdkVersion(AndroidConfig.targetSdk) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - versionCode = 60 + versionCode = 61 versionName = "0.10.12" buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"") diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index a693d7496..09512b186 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -182,6 +182,14 @@ object Migrations { remove("pref_default_viewer_key") } } + if (oldVersion < 61) { + // Handle removed every 1 or 2 hour library updates + val updateInterval = preferences.libraryUpdateInterval().get() + if (updateInterval == 1 || updateInterval == 2) { + preferences.libraryUpdateInterval().set(3) + LibraryUpdateJob.setupTask(context, 3) + } + } return true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsLibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsLibraryController.kt index 7dd216057..3f8baf1bc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsLibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsLibraryController.kt @@ -126,8 +126,6 @@ class SettingsLibraryController : SettingsController() { titleRes = R.string.pref_library_update_interval entriesRes = arrayOf( R.string.update_never, - R.string.update_1hour, - R.string.update_2hour, R.string.update_3hour, R.string.update_4hour, R.string.update_6hour, @@ -137,7 +135,7 @@ class SettingsLibraryController : SettingsController() { R.string.update_48hour, R.string.update_weekly ) - entryValues = arrayOf("0", "1", "2", "3", "4", "6", "8", "12", "24", "48", "168") + entryValues = arrayOf("0", "3", "4", "6", "8", "12", "24", "48", "168") defaultValue = "24" summary = "%s" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a8c832eb7..85b808f09 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -198,8 +198,6 @@ Global update Update frequency Manual - Hourly - Every 2 hours Every 3 hours Every 4 hours Every 6 hours