mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
book reading statistics for djvu documents
This commit is contained in:
@@ -17,7 +17,7 @@ local ReaderStatus = InputContainer:new {
|
||||
}
|
||||
|
||||
function ReaderStatus:init()
|
||||
if self.ui.document.is_djvu or self.ui.document.is_pic then
|
||||
if self.ui.document.is_pic then
|
||||
self.enabled = false
|
||||
return
|
||||
else
|
||||
|
||||
@@ -155,10 +155,6 @@ function CreDocument:getCoverPageImage()
|
||||
end
|
||||
end
|
||||
|
||||
function Document:getProps()
|
||||
return self._document:getDocumentProps()
|
||||
end
|
||||
|
||||
function CreDocument:getWordFromPosition(pos)
|
||||
local word_box = self._document:getWordFromPosition(pos.x, pos.y)
|
||||
DEBUG("CreDocument: get word box", word_box)
|
||||
|
||||
@@ -41,6 +41,14 @@ function DjvuDocument:init()
|
||||
self:_readMetadata()
|
||||
end
|
||||
|
||||
function DjvuDocument:getProps()
|
||||
local _, _, docname = self.file:find(".*/(.*)")
|
||||
docname = docname or self.file
|
||||
return {
|
||||
title = docname:match("(.*)%.")
|
||||
}
|
||||
end
|
||||
|
||||
function DjvuDocument:getPageTextBoxes(pageno)
|
||||
return self._document:getPageText(pageno)
|
||||
end
|
||||
|
||||
@@ -144,6 +144,10 @@ function Document:getNativePageDimensions(pageno)
|
||||
return page_size
|
||||
end
|
||||
|
||||
function Document:getProps()
|
||||
return self._document:getDocumentProps()
|
||||
end
|
||||
|
||||
function Document:_readMetadata()
|
||||
self.mod_time = lfs.attributes(self.file, "modification")
|
||||
self.info.number_of_pages = self._document:getPages()
|
||||
|
||||
@@ -38,7 +38,7 @@ local ReaderStatistics = InputContainer:new {
|
||||
}
|
||||
|
||||
function ReaderStatistics:init()
|
||||
if self.ui.document.is_djvu or self.ui.document.is_pic then
|
||||
if self.ui.document.is_pic then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user