View Single Post
Old 02-12-2013, 01:38 AM   #9
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
A few things have been covered in the thread and I'm a little unsure about were we are up to. I am going to be long-winded, pedantic and detailed in the answer.

When you add a book to calibre, it gets the author and title from somewhere. Where depends on the type and options. For an epub, it can get the authors from the metadata. For your example, calibre would read two authors and store those in its metadata database. But, when it stores the book in its library, only the first author is used for the file name and directory structure.

When calibre sends a book to a Kobo device, exactly what happens depends on the settings. The "save template" is used for the file name and directory. The default is to use the {sort_author} so all authors will be included. The metadata is updated so that there is a "creator" element for each author. The first one will have the "file-as" property. This is set to the {sort_author}.

When the Kobo device process the book, it uses the first creator element for the author. It uses the text part of the element without change (except decoding HTML elements). As calibre only puts a single name in each creator element, the device only puts one author name in the database. But if you do have an epub with multiple names in the first creator element, they will be used. See https://www.mobileread.com/forums/sho...d.php?t=202664 for some discussion on this.

Apparently what happens when you use calibre to copy the book back from the device, is different from what I thought. Calibre gets the metadata for all books on the device when the device is connected, and uses that from then on. In the case where calibre doesn't already have the book in its library, that means the metadata comes from the database on the device. I thought that when you copied the book back from the device, that calibre would use metadata that is in memory. But, it appears from your testing, that it gets it from the book. This probably means that calibre is using the same rules for getting the metadata that it uses when you add a new book from elsewhere.

The last bit is the matching between the library and the device. This is done in a few ways. Calibre maintains a file called "metadata.calibre" in the root of the device. This is updated each time the device is connected and there are changes or a book is sent to the device. During the initial sync this is read to do the matching. If the file is missing or a book on the device is not in the file, calibre matches on other information. The main way is using the author and title. But it can also use an id that some epubs have. At the end of this, the book is added to the metadata.calibre for future connections. This means that once calibre has matched the book on a device to a book in the library, changing the metadata shouldn't make it loose the book.

I think that covers everything. If it doesn't, yell at me. If it contradicts what anyone is seeing, yell louder. And if you find a bug in the driver, yell even loader but clearly so I can fix it
davidfor is offline   Reply With Quote