OPDSBrowser: Unbreak test (#7393)

reviewable/pr7395/r1
NiLuJe 3 years ago committed by GitHub
parent bf6c0cdd6c
commit 48b0f2242c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
Subproject commit 30c52feddbbb18fff7e1400751e442cbd643ab77
Subproject commit db20367b4320b16eda10010ce64da59074ea8fd3

@ -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 = {}

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

Loading…
Cancel
Save