diff --git a/src/Kobo/Response/SyncResponse.php b/src/Kobo/Response/SyncResponse.php index b6d22ccd..b6d7f35e 100644 --- a/src/Kobo/Response/SyncResponse.php +++ b/src/Kobo/Response/SyncResponse.php @@ -127,7 +127,7 @@ private function createReadingState(Book $book): array 'PriorityTimestamp' => $this->syncToken->maxLastCreated($book->getCreated(), $this->syncToken->currentDate), 'StatusInfo' => [ - 'LastModified' => $book->getLastInteraction($this->kobo->getUser())?->getUpdated(), + 'LastModified' => $this->syncToken->maxLastModified($book->getLastInteraction($this->kobo->getUser())?->getUpdated(), $this->getLastBookmarkDate($book), $this->syncToken->currentDate), 'Status' => match ($this->isReadingFinished($book)) { true => SyncResponse::READING_STATUS_FINISHED, false => SyncResponse::READING_STATUS_IN_PROGRESS, @@ -288,4 +288,9 @@ private function createBookmark(?BookmarkUser $bookMark): array return array_filter($values); // Remove null values } + + private function getLastBookmarkDate(Book $book): ?\DateTimeInterface + { + return $this->kobo->getUser()->getBookmarkForBook($book)?->getUpdated(); + } }