Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Made 'Default' category selectable in global update settings (#2318)

(cherry picked from commit b55814a1c0)
Cette révision appartient à :
andrecsilva 2020-01-07 20:46:08 -03:00 révisé par arkon
Parent 51e049ab78
révision a24d670f54
2 fichiers modifiés avec 4 ajouts et 7 suppressions

Voir le fichier

@ -249,7 +249,6 @@ class LibraryUpdateService(
else
db.getLibraryMangas().executeAsBlocking().distinctBy { it.id }
}
if (target == Target.CHAPTERS && preferences.updateOnlyNonCompleted()) {
listToUpdate = listToUpdate.filter { it.status != SManga.COMPLETED }
}

Voir le fichier

@ -141,17 +141,17 @@ class SettingsGeneralController : SettingsController() {
}
val dbCategories = db.getCategories().executeAsBlocking()
val categories = listOf(Category.createDefault()) + dbCategories
multiSelectListPreference {
key = Keys.libraryUpdateCategories
titleRes = R.string.pref_library_update_categories
entries = dbCategories.map { it.name }.toTypedArray()
entryValues = dbCategories.map { it.id.toString() }.toTypedArray()
entries = categories.map { it.name }.toTypedArray()
entryValues = categories.map { it.id.toString() }.toTypedArray()
preferences.libraryUpdateCategories().asObservable()
.subscribeUntilDestroy {
val selectedCategories = it
.mapNotNull { id -> dbCategories.find { it.id == id.toInt() } }
.mapNotNull { id -> categories.find { it.id == id.toInt() } }
.sortedBy { it.order }
summary = if (selectedCategories.isEmpty())
@ -180,8 +180,6 @@ class SettingsGeneralController : SettingsController() {
key = Keys.defaultCategory
titleRes = R.string.default_category
val categories = listOf(Category.createDefault()) + dbCategories
val selectedCategory = categories.find { it.id == preferences.defaultCategory() }
entries = arrayOf(context.getString(R.string.default_category_summary)) +
categories.map { it.name }.toTypedArray()