From b55814a1c053e73d39e03e7ffbd8489644763270 Mon Sep 17 00:00:00 2001 From: andrecsilva <12188364+andrecsilva@users.noreply.github.com> Date: Tue, 7 Jan 2020 20:46:08 -0300 Subject: [PATCH] Made 'Default' category selectable in global update settings (#2318) --- .../tachiyomi/data/library/LibraryUpdateService.kt | 1 - .../tachiyomi/ui/setting/SettingsGeneralController.kt | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index 0b9517c5b6..b43a0274c5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -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 } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index 04c25d182c..f50b97d2fe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -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()