From be371277ebca43a510af6329a5f6bfa1cb94fdf8 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 2 Sep 2024 16:55:11 +0800 Subject: [PATCH] fix(kobo): use the total progression sent by Kobo --- .../kotlin/org/gotson/komga/domain/service/BookLifecycle.kt | 4 ++-- .../org/gotson/komga/interfaces/api/kobo/KoboController.kt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/komga/src/main/kotlin/org/gotson/komga/domain/service/BookLifecycle.kt b/komga/src/main/kotlin/org/gotson/komga/domain/service/BookLifecycle.kt index ad517115b86..5936f0e24f6 100644 --- a/komga/src/main/kotlin/org/gotson/komga/domain/service/BookLifecycle.kt +++ b/komga/src/main/kotlin/org/gotson/komga/domain/service/BookLifecycle.kt @@ -494,8 +494,8 @@ class BookLifecycle( newProgression.modified.toLocalDateTime().toCurrentTimeZone(), newProgression.device.id, newProgression.device.name, - // use the type we have instead of the one provided, as well as the total progression we computed - newProgression.locator.copy(type = matchedPosition.type, locations = newProgression.locator.locations?.copy(totalProgression = totalProgression)), + // use the type we have instead of the one provided + newProgression.locator.copy(type = matchedPosition.type), ) } } diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/kobo/KoboController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/kobo/KoboController.kt index 61c88a58224..8d125c806c8 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/api/kobo/KoboController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/api/kobo/KoboController.kt @@ -452,6 +452,7 @@ class KoboController( locations = R2Locator.Location( progression = koboUpdate.currentBookmark.contentSourceProgressPercent / 100, + totalProgression = koboUpdate.currentBookmark.progressPercent?.div(100), ), ) },