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

Dumb lazy workaround for <https://github.com/koreader/koreader/issues/6251>.
This commit is contained in:
Frans de Jonge
2020-06-10 21:54:57 +02:00
committed by GitHub
parent 3e3ddbfc4b
commit 04a5e2acfa

View File

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