mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fixed manga autodownloading chapters if manga was not initalized before
This commit is contained in:
parent
8fe80a0ff9
commit
c70f4025f4
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue