diff --git a/main.lua b/main.lua index cfb463d..0ff4e71 100644 --- a/main.lua +++ b/main.lua @@ -785,7 +785,6 @@ function Bookhoard:collectBookData() title = title, authors = authors, percentage = percentage, - epubcfi = progress, context_text = context_text, page = page, total_pages = total_pages, @@ -796,6 +795,15 @@ function Bookhoard:collectBookData() }, } + -- epubcfi (a CREngine xpointer) is only meaningful for reflowable (rolling) + -- documents. Paging docs (PDF/comics/DjVu) carry their position in + -- page/total_pages; a bare page number here would be a JSON number into a + -- server *string field and fail the bind. Reflowable EPUBs are always + -- rolling, so they keep sending the xpointer exactly as before. + if not self.ui.document.info.has_pages then + book_data.epubcfi = progress + end + return book_data end