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.
reviewable/pr11135/r1
Ben Bell 6 months ago committed by GitHub
parent dea94026f1
commit f92c0eae3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save