Reestablish 1.37 upload behaviour

This commit is contained in:
jpirnay
2026-04-24 15:35:56 +02:00
parent ea2c0f77c8
commit 7c15c8aa85
2 changed files with 13 additions and 22 deletions
@@ -38,12 +38,16 @@ via a KOReader contributor mapping spine items to DocFragment numbers.
Implemented in `ProgressMapper::toKOReader`.
1. Compute overall `percentage` from chapter/page.
2. If a paragraph index is available from the section cache LUT (`CrossPointPosition::hasParagraphIndex`),
generate an XPath directly: `/body/DocFragment[spineIndex + 1]/body/p[paragraphIndex]`.
3. Otherwise, attempt byte-offset estimation via `ChapterXPathIndexer::findXPathForProgress`.
4. If XPath extraction fails, fallback to synthetic chapter path:
2. Generate XPath via byte-offset estimation (`ChapterXPathIndexer::findXPathForProgress`),
producing a `…/text()[K].M` anchor proportional to intra-spine progress.
3. If XPath extraction fails, fallback to synthetic chapter path:
- `/body/DocFragment[spineIndex + 1]/body`
The paragraph LUT (see below) is intentionally **not** used for upload: snapping to the
start of `p[N]` when the user is mid-paragraph causes pulled positions to land at the
start of the paragraph (and at the start of the chapter when an opening paragraph spans
many pages). The LUT remains in use for the reverse direction.
### KOReader -> CrossPoint
Implemented in `ProgressMapper::toCrossPoint`.