mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 19:04:39 -05:00
Prevent chapter lastReadPage coerceIn error (#1272)
coerceIn throws an error in case the max value is less than the min value ("Cannot coerce value to an empty range: maximum <max> is less than minimum <min>")
Regression from c8bd39b4bf
This commit is contained in:
@@ -85,7 +85,7 @@ class ChapterMutation {
|
||||
this[ChapterTable.isBookmarked] = it
|
||||
}
|
||||
patch.lastPageRead?.also {
|
||||
this[ChapterTable.lastPageRead] = it.coerceIn(0, chapterIdToPageCount[chapterId])
|
||||
this[ChapterTable.lastPageRead] = it.coerceAtMost(chapterIdToPageCount[chapterId] ?: 0).coerceAtLeast(0)
|
||||
this[ChapterTable.lastReadAt] = now
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user