From 2c14a8dee168b297ecab13894316934916ed03be Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 11 Sep 2021 18:39:29 -0400 Subject: [PATCH] Minor cleanup for download delete exclusion --- .../kanade/tachiyomi/data/download/DownloadManager.kt | 10 ++++------ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 9c01afa1ba..8cfe8ad9bb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -345,12 +345,10 @@ class DownloadManager( private fun getChaptersToDelete(chapters: List, manga: Manga): List { // Retrieve the categories that are set to exclude from being deleted on read val categoriesToExclude = preferences.removeExcludeCategories().get().map(String::toInt) - val categoriesForManga = - manga.let { it -> - db.getCategoriesForManga(it).executeAsBlocking() - .mapNotNull { it.id } - .takeUnless { it.isEmpty() } - } ?: listOf(0) + val categoriesForManga = db.getCategoriesForManga(manga).executeAsBlocking() + .mapNotNull { it.id } + .takeUnless { it.isEmpty() } + ?: listOf(0) return if (categoriesForManga.intersect(categoriesToExclude).isNotEmpty()) { chapters.filterNot { it.read } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 59b5741670..65923b90ef 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -382,7 +382,7 @@ After marked as read Automatically after reading Allow deleting bookmarked chapters - Categories to exclude in deleting + Excluded categories Custom location Disabled Last read chapter