Fix readded chapters polluting 'Updates' tab. (#6377)

(cherry picked from commit 7eed8c440c2a8c2c2b65bf20118398fea6ab1fae)
This commit is contained in:
FourTOne5 2021-12-24 20:28:48 +06:00 committed by Jobobby04
parent 25091e80c1
commit 0e437eaa6a

View File

@ -122,11 +122,17 @@ fun syncChaptersWithSource(
for (i in toAdd.indices.reversed()) {
val chapter = toAdd[i]
chapter.date_fetch = now++
// Try to mark already read chapters as read when the source deletes them
if (chapter.isRecognizedNumber && chapter.chapter_number in deletedReadChapterNumbers) {
chapter.read = true
}
if (chapter.isRecognizedNumber && chapter.chapter_number in deletedChapterNumbers) {
// Try to mark already read chapters as read when the source deletes them
if (chapter.chapter_number in deletedReadChapterNumbers) {
chapter.read = true
}
// Try to to use the fetch date it originally had to not pollute 'Updates' tab
toDelete.filter { it.chapter_number == chapter.chapter_number }
.minByOrNull { it.date_fetch }!!.let {
chapter.date_fetch = it.date_fetch
}
readded.add(chapter)
}
}