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:
@@ -666,9 +666,9 @@ function Bookhoard:collectBookData()
|
||||
local file_path = self.ui.document.file
|
||||
|
||||
local title = props.display_title or ""
|
||||
local authors = ""
|
||||
local authors = {}
|
||||
if props.authors then
|
||||
authors = props.authors
|
||||
authors = { props.authors }
|
||||
end
|
||||
|
||||
local file_sha256 = self:getFileSHA256()
|
||||
@@ -679,18 +679,12 @@ function Bookhoard:collectBookData()
|
||||
local page = self.ui:getCurrentPage()
|
||||
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 = {
|
||||
uuid = book_uuid,
|
||||
sha256 = file_sha256,
|
||||
title = title,
|
||||
authors = authors,
|
||||
percentage = percentage,
|
||||
chapter = chapter,
|
||||
epubcfi = progress,
|
||||
page = page,
|
||||
total_pages = total_pages,
|
||||
|
||||
Reference in New Issue
Block a user