From 48b0f2242cf3b21a0900ff5da185067ad8211cfa Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 7 Mar 2021 00:05:41 +0100 Subject: [PATCH] OPDSBrowser: Unbreak test (#7393) --- base | 2 +- plugins/opds.koplugin/opdsbrowser.lua | 4 ++-- spec/unit/opds_spec.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base b/base index 30c52fedd..db20367b4 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 30c52feddbbb18fff7e1400751e442cbd643ab77 +Subproject commit db20367b4320b16eda10010ce64da59074ea8fd3 diff --git a/plugins/opds.koplugin/opdsbrowser.lua b/plugins/opds.koplugin/opdsbrowser.lua index 8953cef1e..35e756f4b 100644 --- a/plugins/opds.koplugin/opdsbrowser.lua +++ b/plugins/opds.koplugin/opdsbrowser.lua @@ -383,7 +383,7 @@ function OPDSBrowser:getSearchTemplate(osd_url, username, password) if search_descriptor and search_descriptor.OpenSearchDescription and search_descriptor.OpenSearchDescription.Url then for _, candidate in ipairs(search_descriptor.OpenSearchDescription.Url) do if candidate.type and candidate.template and candidate.type:find(self.search_template_type) then - return candidate.template:gsub('{searchTerms}', '%%s') + return candidate.template:gsub("{searchTerms}", "%%s") end end end @@ -413,7 +413,7 @@ function OPDSBrowser:genItemTableFromCatalog(catalog, item_url, username, passwo end if link.type:find(self.search_type) then if link.href then - local stpl = self:getSearchTemplate(link.href, username, password) + local stpl = self:getSearchTemplate(build_href(link.href), username, password) -- insert the search item local item = {} item.acquisitions = {} diff --git a/spec/unit/opds_spec.lua b/spec/unit/opds_spec.lua index 6fe6db7f7..3a498b4f8 100644 --- a/spec/unit/opds_spec.lua +++ b/spec/unit/opds_spec.lua @@ -278,7 +278,7 @@ describe("OPDS module #nocov", function() local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://m.gutenberg.org/ebooks.opds/?format=opds") assert.truthy(item_table) - assert.are.same(item_table[1].title, "Search") + assert.are.same(item_table[1].text, "Search") end) it("should generate URL on rel=subsection", function() local catalog = OPDSParser:parse(navigation_sample)