History: update last book access time#10156
Conversation
| select_enabled_func = function() | ||
| return lfs.attributes(file_path, "mode") == "file" | ||
| end, | ||
| dim = is_file_deleted, | ||
| mandatory = datetime.secondsToDateTime(input_time), | ||
| select_enabled = not is_file_deleted, |
There was a problem hiding this comment.
No need for _func ? If we delete a file from history (with the option "removed deleted file from history" disabled), are we sure we go thru this buildEntry() to get updated info ?
edit: OK, I see below that you update this field when deleting. Keeping that comment just for you to answer "all is good and thought of" :)
| local now = os.time() | ||
| self.hist[1].time = now | ||
| self.hist[1].mandatory = datetime.secondsToDateTime(now) | ||
| self:_flush() |
There was a problem hiding this comment.
Just asking, probably not worth complicating things :):
When switching documents, we will write the history to disk when closing the previous document, and also when loading the new document. No way to avoid one of them ? (ie. updating in memory self.hist, but avoiding the _flush() as not essential if it's still the last document?)
There was a problem hiding this comment.
Maybe the tearing_down flag can help, I'll look at it.
NiLuJe
left a comment
There was a problem hiding this comment.
Reviewed 3 of 5 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @hius07 and @poire-z)
|
Edit: never mind, doesn't seem to be due to this PR. |
Updates book access time on closing the document.
Do not use sdr mtime to get the last access time. See #10149 (comment)
(Minor optimization of calling
secondsToDateTime).This change is