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>
This commit is contained in:
Jays2Kings 2021-07-03 16:27:24 -04:00
parent 6717f7dd3b
commit 656192f7cd
2 changed files with 9 additions and 4 deletions

View File

@ -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
}

View File

@ -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 ->