Remove 1 or 2 hour library updates to avoid DDoSing sources
(cherry picked from commit 569df39fb88e534fa0deb5b9a412f84936006859) # Conflicts: # app/build.gradle.kts
This commit is contained in:
parent
1389649553
commit
eaa2bb22ed
@ -179,6 +179,14 @@ object Migrations {
|
|||||||
remove("pref_default_viewer_key")
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +150,6 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
titleRes = R.string.pref_library_update_interval
|
titleRes = R.string.pref_library_update_interval
|
||||||
entriesRes = arrayOf(
|
entriesRes = arrayOf(
|
||||||
R.string.update_never,
|
R.string.update_never,
|
||||||
R.string.update_1hour,
|
|
||||||
R.string.update_2hour,
|
|
||||||
R.string.update_3hour,
|
R.string.update_3hour,
|
||||||
R.string.update_4hour,
|
R.string.update_4hour,
|
||||||
R.string.update_6hour,
|
R.string.update_6hour,
|
||||||
@ -161,7 +159,7 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
R.string.update_48hour,
|
R.string.update_48hour,
|
||||||
R.string.update_weekly
|
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"
|
defaultValue = "24"
|
||||||
summary = "%s"
|
summary = "%s"
|
||||||
|
|
||||||
|
@ -276,12 +276,14 @@ object EXHMigrations {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (oldVersion under 18) {
|
if (oldVersion under 18) {
|
||||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
val readerTheme = preferences.readerTheme().get()
|
||||||
val readerTheme = prefs.getInt("pref_reader_theme_key", 3)
|
|
||||||
if (readerTheme == 4) {
|
if (readerTheme == 4) {
|
||||||
prefs.edit {
|
preferences.readerTheme().set(3)
|
||||||
putInt("pref_reader_theme_key", 3)
|
|
||||||
}
|
}
|
||||||
|
val updateInterval = preferences.libraryUpdateInterval().get()
|
||||||
|
if (updateInterval == 1 || updateInterval == 2) {
|
||||||
|
preferences.libraryUpdateInterval().set(3)
|
||||||
|
LibraryUpdateJob.setupTask(context, 3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,8 +201,6 @@
|
|||||||
<string name="pref_category_library_update">Global update</string>
|
<string name="pref_category_library_update">Global update</string>
|
||||||
<string name="pref_library_update_interval">Update frequency</string>
|
<string name="pref_library_update_interval">Update frequency</string>
|
||||||
<string name="update_never">Manual</string>
|
<string name="update_never">Manual</string>
|
||||||
<string name="update_1hour">Hourly</string>
|
|
||||||
<string name="update_2hour">Every 2 hours</string>
|
|
||||||
<string name="update_3hour">Every 3 hours</string>
|
<string name="update_3hour">Every 3 hours</string>
|
||||||
<string name="update_4hour">Every 4 hours</string>
|
<string name="update_4hour">Every 4 hours</string>
|
||||||
<string name="update_6hour">Every 6 hours</string>
|
<string name="update_6hour">Every 6 hours</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user