mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Exporter: fix XMNote export, add author field (#11134)
Optimize #11087 : 1. In `isReadyToExport`, check if the ip is set. If not, then the user cannot enable xmnote export. 2. Add author field in highlights.
This commit is contained in:
@@ -79,6 +79,7 @@ end
|
||||
function XMNoteExporter:createRequestBody(booknotes)
|
||||
local book = {
|
||||
title = booknotes.title or "",
|
||||
author = booknotes.author or "",
|
||||
type = 1,
|
||||
locationUnit = 1,
|
||||
}
|
||||
@@ -151,10 +152,13 @@ end
|
||||
|
||||
|
||||
function XMNoteExporter:isReadyToExport()
|
||||
return true
|
||||
if self.settings.ip then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
function XMNoteExporter:export(t)
|
||||
if not self:isReadyToExport() then return false end
|
||||
|
||||
for _, booknotes in ipairs(t) do
|
||||
local ok = self:createHighlights(booknotes)
|
||||
if not ok then return false end
|
||||
|
||||
Reference in New Issue
Block a user