mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-25 14:51:51 +01:00
Manga set to download chapters now downloads new chapters from manga details refresh
This commit is contained in:
parent
da7adb8197
commit
931e37b903
@ -411,7 +411,18 @@ class MangaDetailsPresenter(
|
|||||||
}
|
}
|
||||||
val finChapters = chapters.await()
|
val finChapters = chapters.await()
|
||||||
if (finChapters.isNotEmpty()) {
|
if (finChapters.isNotEmpty()) {
|
||||||
syncChaptersWithSource(db, finChapters, manga, source)
|
val newChapters = syncChaptersWithSource(db, finChapters, manga, source)
|
||||||
|
if (newChapters.first.isNotEmpty()) {
|
||||||
|
val downloadNew = preferences.downloadNew().getOrDefault()
|
||||||
|
val categoriesToDownload =
|
||||||
|
preferences.downloadNewCategories().getOrDefault().map(String::toInt)
|
||||||
|
val shouldDownload =
|
||||||
|
(downloadNew && (categoriesToDownload.isEmpty() || getMangaCategoryIds().any { it in categoriesToDownload }))
|
||||||
|
if (shouldDownload) {
|
||||||
|
downloadChapters(newChapters.first.sortedBy { it.chapter_number }
|
||||||
|
.map { it.toModel() })
|
||||||
|
}
|
||||||
|
}
|
||||||
withContext(Dispatchers.IO) { updateChapters() }
|
withContext(Dispatchers.IO) { updateChapters() }
|
||||||
}
|
}
|
||||||
isLoading = false
|
isLoading = false
|
||||||
|
Loading…
Reference in New Issue
Block a user