mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-05 22:55:08 +01:00
Don't auto-download chapters if excluded but no categories selected (fixes #6126)
This commit is contained in:
parent
f85dfa90b8
commit
39722055f5
@ -60,7 +60,10 @@ fun Manga.shouldDownloadNewChapters(db: DatabaseHelper, prefs: PreferencesHelper
|
|||||||
if (!downloadNew) return false
|
if (!downloadNew) return false
|
||||||
|
|
||||||
val categoriesToDownload = prefs.downloadNewCategories().get().map(String::toInt)
|
val categoriesToDownload = prefs.downloadNewCategories().get().map(String::toInt)
|
||||||
if (categoriesToDownload.isEmpty()) return true
|
val categoriesToExclude = prefs.downloadNewCategoriesExclude().get().map(String::toInt)
|
||||||
|
|
||||||
|
// Default: download from all categories
|
||||||
|
if (categoriesToDownload.isEmpty() && categoriesToExclude.isEmpty()) return true
|
||||||
|
|
||||||
// Get all categories, else default category (0)
|
// Get all categories, else default category (0)
|
||||||
val categoriesForManga =
|
val categoriesForManga =
|
||||||
@ -68,8 +71,9 @@ fun Manga.shouldDownloadNewChapters(db: DatabaseHelper, prefs: PreferencesHelper
|
|||||||
.mapNotNull { it.id }
|
.mapNotNull { it.id }
|
||||||
.takeUnless { it.isEmpty() } ?: listOf(0)
|
.takeUnless { it.isEmpty() } ?: listOf(0)
|
||||||
|
|
||||||
val categoriesToExclude = prefs.downloadNewCategoriesExclude().get().map(String::toInt)
|
// In excluded category
|
||||||
if (categoriesForManga.intersect(categoriesToExclude).isNotEmpty()) return false
|
if (categoriesForManga.intersect(categoriesToExclude).isNotEmpty()) return false
|
||||||
|
|
||||||
|
// In included category
|
||||||
return categoriesForManga.intersect(categoriesToDownload).isNotEmpty()
|
return categoriesForManga.intersect(categoriesToDownload).isNotEmpty()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user