diff --git a/plugins/opds.koplugin/opdsbrowser.lua b/plugins/opds.koplugin/opdsbrowser.lua index 8e1f84b57..fc737e4f7 100644 --- a/plugins/opds.koplugin/opdsbrowser.lua +++ b/plugins/opds.koplugin/opdsbrowser.lua @@ -496,6 +496,7 @@ function OPDSBrowser:genItemTableFromCatalog(catalog, item_url, username, passwo table.insert(item.acquisitions, { type = link.type, href = build_href(link.href), + title = link.title, }) elseif link.rel == self.thumbnail_rel then item.thumbnail = build_href(link.href) @@ -702,7 +703,11 @@ function OPDSBrowser:showDownloads(item) if filetype then filetype = string.lower(filetype) -- append DOWNWARDS BLACK ARROW ⬇ U+2B07 to format - button.text = string.upper(filetype) .. "\xE2\xAC\x87" + if acquisition.title then + button.text = acquisition.title .. "\xE2\xAC\x87" + else + button.text = string.upper(filetype) .. "\xE2\xAC\x87" + end button.callback = function() self:downloadFile(item, filetype, acquisition.href) UIManager:close(self.download_dialog) diff --git a/spec/unit/opds_spec.lua b/spec/unit/opds_spec.lua index 35a8abe69..a68246c27 100644 --- a/spec/unit/opds_spec.lua +++ b/spec/unit/opds_spec.lua @@ -316,6 +316,7 @@ describe("OPDS module #nocov", function() local entry = entries[2] assert.are.same(entry.title, "1000 Mythological Characters Briefly Described") assert.are.same(entry.link[1].href, "https://www.gutenberg.org/ebooks/42474.epub.images") + assert.are.same(entry.link[1].title, "EPUB (with images)") end) end)