Allow excluding categories from auto-download

Closes #1412

Supersedes #4121
This commit is contained in:
arkon
2021-04-04 17:15:06 -04:00
parent 4f1275ac01
commit 0ca62a4acc
4 changed files with 61 additions and 20 deletions

View File

@@ -68,5 +68,8 @@ fun Manga.shouldDownloadNewChapters(db: DatabaseHelper, prefs: PreferencesHelper
.mapNotNull { it.id }
.takeUnless { it.isEmpty() } ?: listOf(0)
val categoriesToExclude = prefs.downloadNewCategoriesExclude().get().map(String::toInt)
if (categoriesForManga.intersect(categoriesToExclude).isNotEmpty()) return false
return categoriesForManga.intersect(categoriesToDownload).isNotEmpty()
}