소스 검색

Minor cleanup for download delete exclusion

arkon 3 년 전
부모
커밋
2c14a8dee1
2개의 변경된 파일5개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 6
      app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt
  2. 1 1
      app/src/main/res/values/strings.xml

+ 4 - 6
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt

@@ -345,12 +345,10 @@ class DownloadManager(
     private fun getChaptersToDelete(chapters: List<Chapter>, manga: Manga): List<Chapter> {
         // 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 }

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -382,7 +382,7 @@
     <string name="pref_remove_after_marked_as_read">After marked as read</string>
     <string name="pref_remove_after_read">Automatically after reading</string>
     <string name="pref_remove_bookmarked_chapters">Allow deleting bookmarked chapters</string>
-    <string name="pref_remove_exclude_categories">Categories to exclude in deleting</string>
+    <string name="pref_remove_exclude_categories">Excluded categories</string>
     <string name="custom_dir">Custom location</string>
     <string name="disabled">Disabled</string>
     <string name="last_read_chapter">Last read chapter</string>