Compare commits

..

2 Commits

2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import tachiyomi.domain.chapter.interactor.UpdateChapter
import tachiyomi.domain.chapter.model.toChapterUpdate
import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.domain.track.model.Track
import kotlin.math.max
class SyncChapterProgressWithTrack(
private val updateChapter: UpdateChapter,
@ -36,7 +37,8 @@ class SyncChapterProgressWithTrack(
// only take into account continuous reading
val localLastRead = sortedChapters.takeWhile { it.read }.lastOrNull()?.chapterNumber ?: 0F
val updatedTrack = remoteTrack.copy(lastChapterRead = localLastRead.toDouble())
val lastRead = max(remoteTrack.lastChapterRead, localLastRead.toDouble())
val updatedTrack = remoteTrack.copy(lastChapterRead = lastRead)
try {
tracker.update(updatedTrack.toDbTrack())

View File

@ -1,5 +1,5 @@
[versions]
kotlin_version = "2.0.20"
kotlin_version = "2.0.21"
serialization_version = "1.7.3"
xml_serialization_version = "0.86.3"