From 656192f7cd3e8e441043bf7104a55a1d7414c51b Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Sat, 3 Jul 2021 16:27:24 -0400 Subject: [PATCH] Remove 1 or 2 hour library updates to avoid DDoSing sources Also adding weekly option Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com> --- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 6 ++++++ .../tachiyomi/ui/setting/SettingsLibraryController.kt | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 2d1af7f2c2..4b81a171c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -134,6 +134,12 @@ object Migrations { if (preferences.lang().get() in listOf("en-US", "en-GB")) { preferences.lang().set("en") } + // 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(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 f630a82a2e..abfc99e110 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 @@ -103,15 +103,14 @@ class SettingsLibraryController : SettingsController() { titleRes = R.string.library_update_frequency entriesRes = arrayOf( R.string.manual, - R.string.hourly, - R.string.every_2_hours, R.string.every_3_hours, R.string.every_6_hours, R.string.every_12_hours, R.string.daily, - R.string.every_2_days + R.string.every_2_days, + R.string.weekly ) - entryValues = listOf(0, 1, 2, 3, 6, 12, 24, 48) + entryValues = listOf(0, 3, 6, 12, 24, 48, 168) defaultValue = 24 onChange { newValue ->