View Single Post
Old 05-24-2022, 11:04 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
In the database on the device, the table "content" has columns for "DateLastRead" and "___SyncTime". These are set for each book. The former is NULL if the book has not been opened and is updated when you open and close a book. The latter is the timestamp when the book was imported on the device.

The "Date added" sort uses "___SyncTime" for the sort. The Recent sort uses both. At one time it was effectively "IFNULL(DateLastRead, ___SyncTime)". But, now it is "MAX(___SyncTime, DateLastRead)". Or it was the last time I checked.

Fiddling with the "DateLastRead" is not that useful as it changes as books are opened and hence the Recent sort changes. But, "___SyncTime" can be changed. My Kobo Utilities can update this to any date that is in the calibre library. I usually set it to the date column in calibre if I do a factory reset. That effectively maintains the date I originally added the book to the device. I have tried the published date, but, it isn't that meaningful to me for sorting.

For collections, there is a separate date added column for each book. At one time, the "Date added" sort in a collection used this. And the plugin has a function to set this so that book could be sorted by series or something else. That was before series sorting was added. But, from memory, the Date added sort in a collection now uses the ___SyncTime for its sorting. The function is still in the plugin. It simply set the timestamp and then incremented by a second for each book. I haven't tried it for a long time and haven't checked what happens when sorting the collections.

Which sort is is used is remembered. An entry is added to the config file for the collection when you change the sort.
davidfor is offline   Reply With Quote