View Single Post
Old 01-06-2011, 03:58 AM   #30
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
Quote:
Originally Posted by unboggling View Post
The universe of metadatabookID is larger than bookID. The universe of bookID doesn't include metadatabookID if empty-of-format. Some operations use one universe, other operations use another universe.
To be pedantic (something I am good at):

In calibre, there are two concepts that you have mostly identified. First, there is the notion of 'book', which is the fundamental thing that calibre manipulates. When you edit metadata, send to device, or do almost anything else, you are first-and-foremost operating on a book. Books are abstract. For example, you can't read a calibre book.

The second concept is a 'format'. A format is a file that is part of the data associated with a book (is a child of book). The assumption made is that the format is something you can read, and can have a life independent of calibre.

Thus, in calibre, every book in a given library has what you are calling the metadatabookID. This is one-to-one mapping. Books in another calibre library will have a different metadatabookID, even if you (the human) know that the books are in fact the same.

A book can have zero or more formats. Inside calibre, a format cannot exist without being associated with (is a child of) a book. Books can exist quite happily without formats.

When you export information from calibre (send/save to), you are exporting format files. The resulting files are no longer associated with the book. Because of metadata updating, they may be (probably are) different from the format file still in calibre's library. After export, calibre doesn't know what the files are, and in fact completely forgets about them. Only if the user asks for it does calibre attempt to re-associate an external format file with a book. The most obvious way of 'asking' is to add a format file to the library. The second-most is to connect a device, in which case calibre sniffs over the format files on the device, trying to determine which book (if any) the files are associated with.

Given the above, I argue that the universe of "bookID" is much larger than that of "metadatabookID". BookID includes every format file that exists: whether exported, sent to devices/folders, on dropbox, or put wherever-have-you by the content server. MetadatabookID is strictly associated with a book in a given calibre library. There is no fixed mapping between bookIDs and metadatabookIDs. One can have formats that have no analogous book, and vice versa. Many formats that can be associated with a given book.
chaley is offline   Reply With Quote