mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
ReaderStatistics: Data collection improvements (#6778)
* Update the data collection format & handler to make it much less tortuous * Update the pagecount & resync the stats on document layout changes * Update the database schema to allow doing most queries against a SQL view that rescales the collected data to be accurate regardless of document layout (thanks to @marek-g for the SQL magic ;)). * Add a "reset stats for current book" entry in the list of reset options, one that won't horribly break stats in said book ;). * Fixed a couple of resource (SQL connection) leaks (in ReaderStatistics:getCurrentBookStats & ReaderStatistics:getCurrentBookStats). * Flush stats to the DB on periodical metadata saves. * Minor cosmetic tweaks to the code
This commit is contained in:
@@ -21,7 +21,6 @@ local RenderImage = require("ui/renderimage")
|
||||
local Size = require("ui/size")
|
||||
local TextBoxWidget = require("ui/widget/textboxwidget")
|
||||
local TextWidget = require("ui/widget/textwidget")
|
||||
local TimeVal = require("ui/timeval")
|
||||
local ToggleSwitch = require("ui/widget/toggleswitch")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local VerticalGroup = require("ui/widget/verticalgroup")
|
||||
@@ -231,9 +230,8 @@ function BookStatusWidget:genHeader(title)
|
||||
end
|
||||
|
||||
function BookStatusWidget:onChangeBookStatus(option_name, option_value)
|
||||
local curr_time = TimeVal:now()
|
||||
self.summary.status = option_name[option_value]
|
||||
self.summary.modified = os.date("%Y-%m-%d", curr_time.sec)
|
||||
self.summary.modified = os.date("%Y-%m-%d", os.time())
|
||||
self:saveSummary()
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user