mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-26 02:48:24 +01:00
Minor cleanup for download delete exclusion
This commit is contained in:
parent
917a283bd1
commit
2c14a8dee1
@ -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 }
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user