Quote:
Originally Posted by JDesat
Just an update. I ended up having to log out and log back in and therefore rebuild the database (which I didn't want to do) but I at least found a quick fix for the books not being in the collections like I want. There's a table in the KoboReader database called ShelfContent. I was able to export that table from the corrupt database and import it into the new database (where it was blank) and everything appeared back on my shelves. The only downside is that nothing is in the order I want it even though the date is in that particular table.
If anyone knows of a way to get the books in the right order by date they were last accessed or even date they were originally uploaded, I'd be very appreciative.
|
From memory, the date in the ShelfContent isn't used for sorting. The "Date Added" sort is the date the book was added to the device, or more strictly, when it was imported by nickel. The "Recent" sort is the latter of the date added and the last read date. (I need to check that. At one time it was the "LastReadDate" if it was not null, and the "___SyncTime" if it was. I haven't checked for a while.)
If you want to change the orders, you need to modify the "___SyncTime" of the books entry in the content table. When importing sideloaded books, this timetamp is set for each book as it is added. For a batch of sideloaded books, which includes the import after signing in, the books are added with the same timestamp in "___SyncTime" and sorting by "Date Modified" or "Recent" will sort the books by title within ___SyncTime (assuming no books have a value in "DateLastRead").
As I mentioned above, the Kobo Utilities can set the ___SyncTime using any of the dates in the calibre library. I normally use the "Date" column as that defaults to the date the book was added to the library and is roughly the order I add them to the devices. This is part of the "Update metadata in device library" function.
For the collections, if you did that from calibre, it will mean that it automatically gets recreated after any issues like this. And, there plugin has a way to fetch the existing collections into calibre which you can then send back.