[fix, plugin] Wallabag: add quiet option to callAPI() (#6252)

Dumb lazy workaround for <https://github.com/koreader/koreader/issues/6251>.
reviewable/pr6254/r1
Frans de Jonge 4 years ago committed by GitHub
parent 3e3ddbfc4b
commit 04a5e2acfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -366,7 +366,7 @@ function Wallabag:getArticleList()
.. "&page=" .. page
.. "&perPage=" .. self.articles_per_sync
.. filtering
local articles_json = self:callAPI("GET", articles_url, nil, "", "")
local articles_json = self:callAPI("GET", articles_url, nil, "", "", true)
if not articles_json then
-- we may have hit the last page, there are no more articles
@ -485,7 +485,7 @@ end
-- body: empty string if not needed
-- filepath: downloads the file if provided, returns JSON otherwise
---- @todo separate call to internal API from the download on external server
function Wallabag:callAPI(method, apiurl, headers, body, filepath)
function Wallabag:callAPI(method, apiurl, headers, body, filepath, quiet)
local request, sink = {}, {}
local parsed
@ -556,7 +556,7 @@ function Wallabag:callAPI(method, apiurl, headers, body, filepath)
os.remove(filepath)
logger.dbg("Wallabag: Removed failed download: ", filepath)
end
else
elseif not quiet then
UIManager:show(InfoMessage:new{
text = _("Communication with server failed."), })
end

Loading…
Cancel
Save