Skip to content

Commit

Permalink
handle OPDS catalog responses accordingly
Browse files Browse the repository at this point in the history
- handle moved permanently HTTP 301
- handle authentication required HTTP 401
- handle authentication errors HTTP 403
- handle catalog not found HTTP 404
  • Loading branch information
edoput committed Aug 22, 2019
1 parent 4a88816 commit 5f1202b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/ui/widget/opdsbrowser.lua
Expand Up @@ -298,6 +298,22 @@ function OPDSBrowser:fetchFeed(item_url, username, password, method)
if xml ~= "" then
return xml
end
elseif code == 301 then
UIManager:show(InfoMessage:new{
text = T(_("Catalog has been permanently moved. Update catalog URL to %1"), headers['Location']),
})
else if code == 401 then
UIManager:show(InfoMessage:new{
text = T(_("Authentication required for catalog, please add username and password")),
})
else if code == 403 then
UIManager:show(InfoMessage:new{
text = T(_("Could not authenticate, check your username and password")),
})
else if code == 404 then
UIManager:show(InfoMessage:new{
text = T(_("Catalog not found")),
})
else
UIManager:show(InfoMessage:new{
text = T(_("Cannot get catalog. Server code response %1"), code),
Expand Down

0 comments on commit 5f1202b

Please sign in to comment.