mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 01:35:09 +01:00
Fixed manga autodownloading chapters if manga was not initalized before
This commit is contained in:
parent
8fe80a0ff9
commit
c70f4025f4
@ -396,6 +396,7 @@ class MangaDetailsPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val networkManga = nManga.await()
|
val networkManga = nManga.await()
|
||||||
|
val mangaWasInitalized = manga.initialized
|
||||||
if (networkManga != null) {
|
if (networkManga != null) {
|
||||||
manga.copyFrom(networkManga)
|
manga.copyFrom(networkManga)
|
||||||
manga.initialized = true
|
manga.initialized = true
|
||||||
@ -412,7 +413,7 @@ class MangaDetailsPresenter(
|
|||||||
val downloadNew = preferences.downloadNew().getOrDefault()
|
val downloadNew = preferences.downloadNew().getOrDefault()
|
||||||
val categoriesToDownload =
|
val categoriesToDownload =
|
||||||
preferences.downloadNewCategories().getOrDefault().map(String::toInt)
|
preferences.downloadNewCategories().getOrDefault().map(String::toInt)
|
||||||
val shouldDownload = !controller.fromCatalogue &&
|
val shouldDownload = !controller.fromCatalogue && mangaWasInitalized
|
||||||
(downloadNew && (categoriesToDownload.isEmpty() || getMangaCategoryIds().any { it in categoriesToDownload }))
|
(downloadNew && (categoriesToDownload.isEmpty() || getMangaCategoryIds().any { it in categoriesToDownload }))
|
||||||
if (shouldDownload) {
|
if (shouldDownload) {
|
||||||
downloadChapters(newChapters.first.sortedBy { it.chapter_number }
|
downloadChapters(newChapters.first.sortedBy { it.chapter_number }
|
||||||
|
Loading…
Reference in New Issue
Block a user