Fix progress sync: match server schema for authors and chapter

- authors: changed from string to array (server expects []string)
- chapter: removed (server expects *int, not a title string)
This commit is contained in:
2026-05-30 10:16:46 -04:00
parent edc4d5b3b5
commit ac84585e50
+2 -8
View File
@@ -666,9 +666,9 @@ function Bookhoard:collectBookData()
local file_path = self.ui.document.file local file_path = self.ui.document.file
local title = props.display_title or "" local title = props.display_title or ""
local authors = "" local authors = {}
if props.authors then if props.authors then
authors = props.authors authors = { props.authors }
end end
local file_sha256 = self:getFileSHA256() local file_sha256 = self:getFileSHA256()
@@ -679,18 +679,12 @@ function Bookhoard:collectBookData()
local page = self.ui:getCurrentPage() local page = self.ui:getCurrentPage()
local total_pages = self.ui.document:getPageCount() local total_pages = self.ui.document:getPageCount()
local chapter = ""
if self.ui.toc and self.ui.toc.getTocTitleOfCurrentPage then
chapter = self.ui.toc:getTocTitleOfCurrentPage() or ""
end
local book_data = { local book_data = {
uuid = book_uuid, uuid = book_uuid,
sha256 = file_sha256, sha256 = file_sha256,
title = title, title = title,
authors = authors, authors = authors,
percentage = percentage, percentage = percentage,
chapter = chapter,
epubcfi = progress, epubcfi = progress,
page = page, page = page,
total_pages = total_pages, total_pages = total_pages,