Resync properly

This commit is contained in:
jpirnay
2026-05-04 17:38:24 +02:00
parent ae746a8127
commit b0921ab3c8
+3 -4
View File
@@ -897,8 +897,8 @@ void EpubReaderActivity::applyPendingSyncSession() {
int restoreSpineIndex = sync.spineIndex; int restoreSpineIndex = sync.spineIndex;
int restorePage = sync.page; int restorePage = sync.page;
pendingParagraphLookup = sync.hasParagraphIndex; pendingParagraphLookup = false;
pendingParagraphIndex = sync.paragraphIndex; pendingParagraphIndex = 0;
if (restoreSpineIndex < 0 || restoreSpineIndex >= epub->getSpineItemsCount()) { if (restoreSpineIndex < 0 || restoreSpineIndex >= epub->getSpineItemsCount()) {
LOG_ERR("ERS", "Invalid sync restore spine index %d, resetting to 0", restoreSpineIndex); LOG_ERR("ERS", "Invalid sync restore spine index %d, resetting to 0", restoreSpineIndex);
@@ -916,8 +916,7 @@ void EpubReaderActivity::applyPendingSyncSession() {
LOG_DBG("ERS", "Applied synced remote position: spine=%d page=%d paragraph=%u hasParagraph=%s", restoreSpineIndex, LOG_DBG("ERS", "Applied synced remote position: spine=%d page=%d paragraph=%u hasParagraph=%s", restoreSpineIndex,
restorePage, pendingParagraphIndex, pendingParagraphLookup ? "yes" : "no"); restorePage, pendingParagraphIndex, pendingParagraphLookup ? "yes" : "no");
} else { } else {
LOG_DBG("ERS", "Restored local pre-sync position: spine=%d page=%d paragraph=%u hasParagraph=%s", restoreSpineIndex, LOG_DBG("ERS", "Restored local pre-sync position: spine=%d page=%d", restoreSpineIndex, restorePage);
restorePage, pendingParagraphIndex, pendingParagraphLookup ? "yes" : "no");
} }
// sync.totalPagesInSpine is the page count of the local spine at launch time. // sync.totalPagesInSpine is the page count of the local spine at launch time.