mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Prevent negative lastPageRead values (#1267)
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
This commit is contained in:
@@ -85,7 +85,7 @@ class ChapterMutation {
|
||||
this[ChapterTable.isBookmarked] = it
|
||||
}
|
||||
patch.lastPageRead?.also {
|
||||
this[ChapterTable.lastPageRead] = it.coerceAtMost(chapterIdToPageCount[chapterId] ?: 0).coerceAtLeast(0)
|
||||
this[ChapterTable.lastPageRead] = it.coerceIn(0, chapterIdToPageCount[chapterId])
|
||||
this[ChapterTable.lastReadAt] = now
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user