mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Fix readded chapters polluting 'Updates' tab. (#6377)
This commit is contained in:
parent
1ab12e380a
commit
7eed8c440c
1 changed files with 10 additions and 4 deletions
|
@ -121,11 +121,17 @@ fun syncChaptersWithSource(
|
||||||
for (i in toAdd.indices.reversed()) {
|
for (i in toAdd.indices.reversed()) {
|
||||||
val chapter = toAdd[i]
|
val chapter = toAdd[i]
|
||||||
chapter.date_fetch = now++
|
chapter.date_fetch = now++
|
||||||
|
|
||||||
|
if (chapter.isRecognizedNumber && chapter.chapter_number in deletedChapterNumbers) {
|
||||||
// Try to mark already read chapters as read when the source deletes them
|
// Try to mark already read chapters as read when the source deletes them
|
||||||
if (chapter.isRecognizedNumber && chapter.chapter_number in deletedReadChapterNumbers) {
|
if (chapter.chapter_number in deletedReadChapterNumbers) {
|
||||||
chapter.read = true
|
chapter.read = true
|
||||||
}
|
}
|
||||||
if (chapter.isRecognizedNumber && chapter.chapter_number in deletedChapterNumbers) {
|
// 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)
|
readded.add(chapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue