wallabag : fixes synchronization when "send review as tags" is checked (#8733)

In this PR https://github.com/koreader/koreader/pull/8637
It worked on my sev environnement, but when updating my device, there
were synchronization errors.

Apparently sometimes documents do not have a summary.
To avoid an error during the synchronisation this change adds checks
when getting tags for the document.
pull/8737/head
Adrien Gallou 2 years ago committed by GitHub
parent b7a2a27590
commit 66afbf15f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -807,6 +807,7 @@ function Wallabag:addTags(path)
if id then
local docinfo = DocSettings:open(path)
if docinfo.data and docinfo.data.summary and docinfo.data.summary.note then
local tags = docinfo.data.summary.note
if tags ~= "" and tags ~= nil then
@ -814,7 +815,7 @@ function Wallabag:addTags(path)
logger.dbg("Wallabag: sending tags ", tags, " for ", path)
local body = {
tags = tags
tags = tags,
}
local bodyJSON = JSON.encode(body)
@ -830,7 +831,7 @@ function Wallabag:addTags(path)
else
logger.dbg("Wallabag: no tags to send for ", path)
end
end
end
end

Loading…
Cancel
Save