diff --git a/plugins/opds.koplugin/opdsbrowser.lua b/plugins/opds.koplugin/opdsbrowser.lua index be29da3b2..bec5cd52b 100644 --- a/plugins/opds.koplugin/opdsbrowser.lua +++ b/plugins/opds.koplugin/opdsbrowser.lua @@ -279,6 +279,7 @@ function OPDSBrowser:fetchFeed(item_url, headers_only) text = text, icon = icon, }) + logger.dbg(string.format("OPDS: Failed to fetch catalog `%s`: %s", item_url, text)) end -- Parses feed to catalog @@ -353,6 +354,7 @@ function OPDSBrowser:genItemTableFromCatalog(catalog, item_url) hrefs[link.rel] = build_href(link.href) end end + -- OpenSearch if link.type:find(self.search_type) then if link.href then table.insert(item_table, { -- the first item in each subcatalog @@ -362,6 +364,16 @@ function OPDSBrowser:genItemTableFromCatalog(catalog, item_url) }) end end + -- Calibre search + if link.type:find(self.search_template_type) and link.rel and link.rel:find("search") then + if link.href then + table.insert(item_table, { + text = "\u{f002} " .. _("Search"), + url = build_href(link.href:gsub("{searchTerms}", "%%s")), + searchable = true, + }) + end + end end end end