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 eb63229387..59b170e60a 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
@@ -114,33 +114,42 @@ class SettingsLibraryController : SettingsController() {
selectedCategories.joinToString { it.name }
}
}
- intListPreference{
+ intListPreference {
key = Keys.libraryUpdatePrioritization
titleRes = R.string.pref_library_update_prioritization
- // The following arrays are to be lined up with the list rankingScheme in:
+
+ // The following array lines up with the list rankingScheme in:
// ../../data/library/LibraryUpdateRanker.kt
- entriesRes = arrayOf(
- R.string.action_sort_alpha,
- R.string.action_sort_last_updated
+ val priorities = arrayOf(
+ Pair("0", R.string.action_sort_alpha),
+ Pair("1", R.string.action_sort_last_updated)
)
- entryValues = arrayOf(
- "0",
- "1"
- )
- defaultValue = "0"
- summaryRes = R.string.pref_library_update_prioritization_summary
+ val defaultPriority = priorities[0]
+
+ entriesRes = priorities.map { it.second }.toTypedArray()
+ entryValues = priorities.map { it.first }.toTypedArray()
+ defaultValue = defaultPriority.first
+
+ val selectedPriority = priorities.find { it.first.toInt() == preferences.libraryUpdatePrioritization().getOrDefault() }
+ summaryRes = selectedPriority?.second ?: defaultPriority.second
+ onChange { newValue ->
+ summaryRes = priorities.find {
+ it.first == (newValue as String)
+ }?.second ?: defaultPriority.second
+ true
+ }
}
intListPreference {
key = Keys.defaultCategory
titleRes = R.string.default_category
- val selectedCategory = categories.find { it.id == preferences.defaultCategory() }
entries = arrayOf(context.getString(R.string.default_category_summary)) +
categories.map { it.name }.toTypedArray()
entryValues = arrayOf("-1") + categories.map { it.id.toString() }.toTypedArray()
defaultValue = "-1"
- summary = selectedCategory?.name ?: context.getString(R.string.default_category_summary)
+ val selectedCategory = categories.find { it.id == preferences.defaultCategory() }
+ summary = selectedCategory?.name ?: context.getString(R.string.default_category_summary)
onChange { newValue ->
summary = categories.find {
it.id == (newValue as String).toInt()
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fba4d407fa..fd046af0a9 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -147,7 +147,6 @@
Categories to include in global update
All
Library update order
- Select the order in which Tachiyomi checks for update
Library update restrictions
Update only when the conditions are met
Wi-Fi