Compare commits

...

2 Commits

Author SHA1 Message Date
Mend Renovate
016f627fb0 Update kotlin monorepo to v2.0.21 (#1314) 2024-10-10 18:21:31 +06:00
brewkunz
44aab7a243 Retain remote last chapter read if it's higher than the local one for EnhancedTracker (#1301) 2024-10-10 18:15:06 +06:00
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"