fix(reader): stop sending epubcfi for fixed-layout documents
The web reader's saveProgress always sent epubcfi: cfi || "", even
for fixed-layout comics/PDFs. Foliate's comic renderer generates a
fake CFI (epubcfi(/6/{n})) for every page via CFI.fake.fromIndex,
which the server stored as a valid locator. These fake CFIs are
meaningless — the page index is the canonical locator for image-based
content — and they caused koreader to crash on pull (see prior commit).
Only set epubcfi in the request body for reflowable documents.
This commit is contained in:
@@ -562,9 +562,11 @@ document.addEventListener("alpine:init", () => {
|
|||||||
? this.book?.sections?.filter((s: any) => s.linear !== "no")
|
? this.book?.sections?.filter((s: any) => s.linear !== "no")
|
||||||
?.length ?? 0
|
?.length ?? 0
|
||||||
: location?.total ?? 0,
|
: location?.total ?? 0,
|
||||||
epubcfi: cfi || "",
|
|
||||||
reading_mode: this.readingMode || undefined,
|
reading_mode: this.readingMode || undefined,
|
||||||
};
|
};
|
||||||
|
if (!this.isFixedLayout) {
|
||||||
|
body.epubcfi = cfi || "";
|
||||||
|
}
|
||||||
|
|
||||||
const tocItem = this.lastRelocateDetail?.tocItem;
|
const tocItem = this.lastRelocateDetail?.tocItem;
|
||||||
if (tocItem) {
|
if (tocItem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user