Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 05-24-2022, 05:50 AM   #1
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
"Recent" sort on Kobo Libra 2

What value is used when sorting by "Recent"? I have that option for my personal collections as well as the built-in collections. Is it a per-collection value or a per-book value? It appears to be per-collection but I can't prove that.

If it is per-collection then is there some way I can choose/set the value for each entry in the collection? That would let me order collections in arbitrary ways. For example, I have a custom series column named "reading order". I would like to make collections from the name ordered by its series index.

If it is per-book then when is it set, and to what?
chaley is offline   Reply With Quote
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,907
Karma: 47303748
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
Old 05-24-2022, 11:54 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
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.
This is done in the Update Metadata panel, changing Date Added? Setting it this way does work, but as you said it isn't useful for changing collection order because it is a per-book field.
Quote:
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.
This is done using "Order Series" panel? This seems not to change how a collection is sorted by Date Added or Recent. Date Added uses the date I set using Update Metadata.

FWIW: I got this exception when changing Date Added in the Update Metadata panel to a date that is undefined for some books.
Spoiler:
Code:
calibre, version 5.42.0
ERROR: Unhandled exception: <b>TypeError</b>:'&lt;' not supported between instances of 'str' and 'int'

calibre 5.42* [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 2) && Count Pages (1, 11, 2) && EpubSplit (3, 3, 0) && Fantastic Fiction (1, 5, 1) && Find Duplicates (1, 9, 5) && Kobo Utilities (2, 16, 0) && Modify ePub (1, 7, 3) && Open With (1, 7, 0) && Quality Check (1, 12, 0) && Reading List (1, 9, 0) && Save Composite Custom Columns (1, 1, 1) && Save Virtual Libraries To Column (2, 0, 1) && Save Virtual Libraries To Column GUI (2, 3, 0) && View Manager (1, 8, 0)
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 958, in update_metadata
  File "calibre_plugins.koboutilities.action", line 4161, in _update_metadata
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\__init__.py", line 407, in strftime
TypeError: '<' not supported between instances of 'str' and 'int'
chaley is offline   Reply With Quote
Old 05-24-2022, 08:14 PM   #4
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
This is done in the Update Metadata panel, changing Date Added? Setting it this way does work, but as you said it isn't useful for changing collection order because it is a per-book field.
This is done using "Order Series" panel? This seems not to change how a collection is sorted by Date Added or Recent. Date Added uses the date I set using Update Metadata.
Yes to both of those places. Digging through my memory, when Shelves/Collections were first added, the Date added sort in a collection worked on the timestamp when the book was added to the collection. At some point it stopped working altogether, or at least gave a seemingly random but consistent sort. The collection was always sorted the same way, but, I could never find the rules used. When that was "fixed", it was done by using the book date added value. Which meant the sort order for a set of books was consistent across all lists but meant there was no way to build another order.
Quote:
FWIW: I got this exception when changing Date Added in the Update Metadata panel to a date that is undefined for some books.
Spoiler:
Code:
calibre, version 5.42.0
ERROR: Unhandled exception: <b>TypeError</b>:'&lt;' not supported between instances of 'str' and 'int'

calibre 5.42* [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 2) && Count Pages (1, 11, 2) && EpubSplit (3, 3, 0) && Fantastic Fiction (1, 5, 1) && Find Duplicates (1, 9, 5) && Kobo Utilities (2, 16, 0) && Modify ePub (1, 7, 3) && Open With (1, 7, 0) && Quality Check (1, 12, 0) && Reading List (1, 9, 0) && Save Composite Custom Columns (1, 1, 1) && Save Virtual Libraries To Column (2, 0, 1) && Save Virtual Libraries To Column GUI (2, 3, 0) && View Manager (1, 8, 0)
Traceback (most recent call last):
  File "calibre_plugins.koboutilities.action", line 958, in update_metadata
  File "calibre_plugins.koboutilities.action", line 4161, in _update_metadata
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\__init__.py", line 407, in strftime
TypeError: '<' not supported between instances of 'str' and 'int'
What date are you using? I'm guessing a custom date column as I think that's the most likely to be not set. And I can see something in the handling of custom date columns that might not be sensible.
davidfor is offline   Reply With Quote
Old 05-25-2022, 05:39 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
What date are you using? I'm guessing a custom date column as I think that's the most likely to be not set. And I can see something in the handling of custom date columns that might not be sensible.
Yes, it is a custom date column. I used my Date Read column for testing.
chaley is offline   Reply With Quote
Old 05-26-2022, 09:03 AM   #6
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I have just released the an update of Kobo Utilities to fix this.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New "VNC" viewer for recent Kobo devices and firmware NiMa Kobo Developer's Corner 23 02-12-2024 06:51 PM
Kindle paperwhite 6.8" or kobo libra 2 7" Irishsea Which one should I buy? 21 01-11-2022 12:14 PM
Deducing "Author sort" and "Title sort" through CLI wladdy Library Management 8 08-04-2020 05:20 AM
Forma How do u deal with authors who are "Jr"? (Kobo ignores Calibre's "Author Sort" field) droopy Kobo Reader 0 09-06-2019 05:51 PM
Touch Kobo Touch "my collections" sort order j-beda Kobo Reader 22 07-19-2015 11:22 PM


All times are GMT -4. The time now is 08:58 PM.


MobileRead.com is a privately owned, operated and funded community.