mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Merge pull request #1751 from apletnev/#1750
#1750 TB feature/statistics issue
This commit is contained in:
@@ -230,7 +230,8 @@ function ReaderFooter:getProgressPercentage()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ReaderFooter:getBookTimeToRead()
|
function ReaderFooter:getBookTimeToRead()
|
||||||
return self:getDataFromStatistics("TB: ", self.pages)
|
local current_page = self.view.document:getCurrentPage()
|
||||||
|
return self:getDataFromStatistics("TB: ", self.pages - current_page)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ReaderFooter:getChapterTimeToRead()
|
function ReaderFooter:getChapterTimeToRead()
|
||||||
|
|||||||
@@ -236,10 +236,11 @@ function ReaderStatistics:updateCurrentStat()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local read_pages = util.tablelength(self.data.performance_in_pages)
|
local read_pages = util.tablelength(self.data.performance_in_pages)
|
||||||
|
local current_page = self.ui.document:getCurrentPage()
|
||||||
local average_time_per_page = self.data.total_time_in_sec / read_pages
|
local average_time_per_page = self.data.total_time_in_sec / read_pages
|
||||||
|
|
||||||
table.insert(stats, { text = _("Current period"), mandatory = util.secondsToClock(self.current_period, false) })
|
table.insert(stats, { text = _("Current period"), mandatory = util.secondsToClock(self.current_period, false) })
|
||||||
table.insert(stats, { text = _("Time to read"), mandatory = util.secondsToClock(self.data.pages * average_time_per_page, false) })
|
table.insert(stats, { text = _("Time to read"), mandatory = util.secondsToClock((self.data.pages - current_page) * average_time_per_page, false) })
|
||||||
table.insert(stats, { text = _("Total time"), mandatory = util.secondsToClock(self.data.total_time_in_sec, false) })
|
table.insert(stats, { text = _("Total time"), mandatory = util.secondsToClock(self.data.total_time_in_sec, false) })
|
||||||
table.insert(stats, { text = _("Total highlights"), mandatory = self.data.highlights })
|
table.insert(stats, { text = _("Total highlights"), mandatory = self.data.highlights })
|
||||||
table.insert(stats, { text = _("Total notes"), mandatory = self.data.notes })
|
table.insert(stats, { text = _("Total notes"), mandatory = self.data.notes })
|
||||||
|
|||||||
Reference in New Issue
Block a user