2
0
mirror of https://github.com/koreader/koreader synced 2024-11-16 06:12:56 +00:00

BookInformation: speedup getting EPUB metadata/cover (#3767)

coverbrowser: also plug optimised callback to the right
button ("Book information" was shifted when "Open with..."
was added)
This commit is contained in:
poire-z 2018-03-17 00:28:37 +01:00 committed by GitHub
parent bc1eefb20b
commit 0fde66c2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -103,7 +103,7 @@ function BookInfo:show(file, book_props)
local loaded = true
local pages
if document.loadDocument then -- CreDocument
if not document:loadDocument() then
if not document:loadDocument(false) then -- load only metadata
-- failed loading, calling other methods would segfault
loaded = false
end
@ -173,6 +173,9 @@ function BookInfo:show(file, book_props)
local widget
local document = DocumentRegistry:openDocument(file)
if document then
if document.loadDocument then -- CreDocument
document:loadDocument(false) -- load only metadata
end
local cover_bb = document:getCoverPageImage()
if cover_bb then
widget = ImageViewer:new{

View File

@ -234,7 +234,7 @@ function CoverMenu:updateItems(select_number)
UIManager:close(self.file_dialog)
-- Replace Book information callback to use directly our bookinfo
orig_buttons[4][2].callback = function()
orig_buttons[4][3].callback = function()
FileManagerBookInfo:show(file, bookinfo)
UIManager:close(self.file_dialog)
end