|
|
|
@ -3,15 +3,15 @@ local MultiInputDialog = require("ui/widget/multiinputdialog")
|
|
|
|
|
local CenterContainer = require("ui/widget/container/centercontainer")
|
|
|
|
|
local UIManager = require("ui/uimanager")
|
|
|
|
|
local Screen = require("device").screen
|
|
|
|
|
local DEBUG = require("dbg")
|
|
|
|
|
local Menu = require("ui/widget/menu")
|
|
|
|
|
local Font = require("ui/font")
|
|
|
|
|
local _ = require("gettext")
|
|
|
|
|
local TimeVal = require("ui/timeval")
|
|
|
|
|
local dump = require("dump")
|
|
|
|
|
local lfs = require("libs/libkoreader-lfs")
|
|
|
|
|
local tableutil = require("tableutil")
|
|
|
|
|
local DEBUG = require("dbg")
|
|
|
|
|
local T = require("ffi/util").template
|
|
|
|
|
local _ = require("gettext")
|
|
|
|
|
local tableutil = require("tableutil")
|
|
|
|
|
|
|
|
|
|
local statistics_dir = "./statistics"
|
|
|
|
|
|
|
|
|
@ -259,9 +259,9 @@ function ReaderStatistics:getDatesForBook(book)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
table.insert(result, { text = _(book.title) })
|
|
|
|
|
table.insert(result, { text = book.title })
|
|
|
|
|
for k, v in tableutil.spairs(dates, function(t, a, b) return t[b].date > t[a].date end) do
|
|
|
|
|
table.insert(result, { text = _(k), mandatory = T(_("Pages (%1) Time: %2"), v.count, os.date("!%X", v.read)) })
|
|
|
|
|
table.insert(result, { text = k, mandatory = T(_("Pages (%1) Time: %2"), v.count, os.date("!%X", v.read)) })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
@ -277,7 +277,7 @@ function ReaderStatistics:updateTotalStat()
|
|
|
|
|
local book_result = self:importFromFile(curr_file)
|
|
|
|
|
if book_result and book_result.title ~= self.data.title then
|
|
|
|
|
table.insert(total_stats, {
|
|
|
|
|
text = _(book_result.title),
|
|
|
|
|
text = book_result.title,
|
|
|
|
|
mandatory = os.date("!%X", tonumber(book_result.total_time)),
|
|
|
|
|
callback = function()
|
|
|
|
|
self.total_status:swithItemTable(nil, self:getDatesForBook(book_result))
|
|
|
|
@ -293,7 +293,7 @@ function ReaderStatistics:updateTotalStat()
|
|
|
|
|
table.insert(total_stats, 1, { text = _("All time"), mandatory = os.date("!%X", total_books_time) })
|
|
|
|
|
table.insert(total_stats, 2, { text = _("----------------------------------------------------") })
|
|
|
|
|
table.insert(total_stats, 3, {
|
|
|
|
|
text = _(self.data.title),
|
|
|
|
|
text = self.data.title,
|
|
|
|
|
mandatory = os.date("!%X", tonumber(self.data.total_time)),
|
|
|
|
|
callback = function()
|
|
|
|
|
self.total_status:swithItemTable(nil, self:getDatesForBook(self.data))
|
|
|
|
|