View Single Post
Old 05-29-2011, 11:44 AM   #2
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The check consists of several parts. Which part depends on whether the book supports metadata (e.g., EPUB) and whether the metadata.calibre file is accurate.

First step: when you connect the device, the file metadata.calibre (on the device) is read and verified. If the books mentioned in metadata.calibre are still located where they were last time calibre saw them, and if the size of the book has not changed, then the metadata in the metadata.calibre file is used. If either check fails, then calibre scans the book for metadata. If it cannot read metadata, then it attempts to get metadata from the file path. The 'read metadata from path' option might play a role here, I don't remember.

Second step: for each book on the device, compare the metadata for the book with the books in calibre's library. There are several ways a book can match.

The first is the UUID. Calibre checks if the book's unique ID (UUID) is in the library. The UUID of the book on the device comes from the metadata.calibre file or the metadata in the file (I think this works only for EPUB). If the UUIDs match, the book as marked as ondevice.

If the UUID does not exist or matches no book, then calibre looks for matches using book metadata. Calibre first computes a shortened version of the book's title. All letters are converted to lower case and all spaces are removed. If these titles for a book in the library and a book on the device match, then a series of sub-checks are applied to see if the book really matches.
  • Subcheck 1: does the book have an the application id (calibre database ID) and if so, does it match? If so, the book is marked as ondevice. This is rare.
  • Subcheck 2: do the authors match? Similar processing is done to authors as to title before the check. If they match, then book is marked as ondevice.
  • Subcheck 3: does author_sort match the book's authors? If so, the book is marked as ondevice.
otherwise the book matches nothing and is not marked as ondevice.

If the metadata.calibre file is being written to the device and is not being corrupted, then it should be the case that any book that calibre puts on the device will be matches. As noted above, this match will fail if the book is moved or changes name on the device, or if the book changes size.

If books you send with calibre are not being marked as ondevice, then one of three things is happening. All of these are on the device:
  1. the metadata.calibre file is being corrupted.
  2. the book is changing names/folders
  3. the book is changing size
I don't know how or why this could be happening. I don't have a kindle, and have no idea what magic it does.
chaley is offline   Reply With Quote