Delete duplicate downloaded chapters when they are automatically marked as read (jobobby04/TachiyomiSY#1252)

(cherry picked from commit 71f2daf8f31238f7d643f86d2f2589f1c8050bf0)
This commit is contained in:
NGB-Was-Taken 2024-08-18 06:09:29 +05:45 committed by Cuong-Tran
parent 6dc3e31f06
commit a9a41f3621
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -707,7 +707,12 @@ class ReaderViewModel @JvmOverloads constructor(
it.chapterNumber.toFloat() == readerChapter.chapter.chapter_number
}
.ifEmpty { null }
?.also { setReadStatus.await(true, *it.toTypedArray()) }
?.also {
setReadStatus.await(true, *it.toTypedArray())
it.forEach { chapter ->
deleteChapterIfNeeded(ReaderChapter(chapter))
}
}
}
if (manga?.isEhBasedManga() == true) {
viewModelScope.launchNonCancellable {