View Single Post
Old 08-12-2012, 07:19 AM   #10
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
OK Mrs_Often, just remember that you asked

Quote:
Originally Posted by Mrs_Often View Post
Davidfor, thanks for the interesting explanation. Could you elaborate a bit on how resending the books from calibre after the device processes could cause the device to use a different version of the cover? And, If you resend a book, do you delete it from the device first?
When the Kobo Touch and I think other Kobo ereaders are disconnected from the USB, they scan the all the books on the device. If the book hasn't been seen before, it is added to its database. Here "seen before" simply means that it isn't in the database. The device does a lot of work when it finds a new book. It will:

- Create a record for the book. This contains the location of the book and some of the metadata. The record is also used to record the state of the book including whether it has been read and how far through you are. It also has details of the type of book or if it is a preview and downloaded. And it has the "ImageID" the device uses to for the cover of the book.

- For each chapter in the table of contents, creates a record in two different tables. This is used to build the TOC when you are reading.

- Generates the cover images (for firmware 1.9.17 and earlier).

This processing is why there can be problems when the device processes new books. The error handling for badly constructed books means that it hangs, reboots or simply stops processing with the broken book.

Now resending a book (yes, I am finally getting to your question) means simply selecting a book that is already on the device in calibre and pressing the "send to device" button. Calibre will simply put a new copy of the book on the device in place of the one that was there. If you have the option to upload the covers, calibre will generate covers and copy them over. Calibre uses the existence of the ImageID I mentioned above to decide it can do this and to name the files. These covers will replace the ones the device generated and will be used in the devices book lists and for the sleep screen.

You can also send a new copy of the book if you have made changes to it. But, firmware 1.9.17, doesn't reprocess it. If you change the metadata or the TOC, the changes don't get picked up and added to the devices database. Generally, this is OK, but if the structure of the file changes, it can cause the device to restart when you try to read the book.

The exception to the above is if you change the title or the authors. These are used in the file names of the books on the device. The device will see the file as a new book.

If you delete the book from the device using calibre, it cleans up the database and file system. All the records related to the book in the device database are deleted, the covers are deleted, the book file is deleted and the directory the book is in is deleted if it is empty. If you send the book to the device after this, the device will see it as a new book when you disconnect.

Quote:
I'm not sure I understand correctly if this resending method would work for FW 2.0.x...
Now, for FW 2.0.x, it works mostly the same. The current Kobo driver in calibre handles the books and covers in a way that the Kobo device is fine with. The device doesn't generate the cover images immediately, but everything else is the same. Almost.

The "almost" is because FW 2.0.x does do some processing of the new version of a book. It doesn't recreate the cover images or change the stored metadata and TOC, but it can decide to completely remove the book. This happens for some changes to the book. Unfortunately, I haven't been able to determine exactly what changes it cause this. I have replaced books with extra chapters (downloaded as the author writes them) and changed CSS and they haven't been deleted. But, changing the title did cause the book to be deleted.

FW 2.0.2 seems to be a little less critical than 2.0.0. I had a lot more books disappear after updating them while I had 2.0.0 than I do with 2.0.2.

Still here? I think that is it. That is probably a lot more than you wanted to know, but there it is.

I better add a disclaimer: The behaviour I describe above for the Kobo Touch is based on my observations. I've done a bit of experimentation to see what happens and had a good look at the database and file structure. The calibre behaviour is again my observations plus looking at the code. Any of this might be wrong. If anyone sees something wrong, please correct me.
davidfor is offline   Reply With Quote