Quote:
Originally Posted by Basilicum
I would like to have an unique number that identifies the book object, rather than relying on title or author that can change.
I found the calibre_id, but not sure this id will survice database replication, splitting and merging. This one seems not to fullful my requirements.
There is also a UUID in the OPF file, but I couildn't find any information who issues this UUID and when. Maybe I could use this one. Can anyone tell me:
is the UUID always generated when a book is created ?
is the UUID never changed ?
Is the OPF file always present ?
thnaks , Basilicum
|
The UUID for a specific book ID plus that ID itself are created by Calibre upon addition to a Library. They are static, as the unique key for a book in Calibre is the book ID (not the Author and Title), and a book ID has only one (1) corresponding UUID. By the way, each Library has a unique UUID too (unless you use your OS file manager to clone it), as does your unique installation of Calibre. The latter is how Calibre keeps statistics on how many users in a specific country in the world are using Calibre.
If you copy a book from a source Library to target Library using Calibre's "Copy", the copied book acquires both a new book ID and a new UUID in the target Library.
If you split each chapter of an epub into its own epub, then each new epub would have both its own ID and UUID.
If you use your OS file manager to replicate an entire Library, including its metadata.db and all of its subordinate folders, then that "new" Library is just a clone, and nothing will change until you use Calibre to change the books within the cloned Library.
The .opf files may or may not be present, and may or may not be "current". That totally depends on how long you leave Calibre running so it can automatically back up any changed metadata to the .opf file for each book that was changed. If you delete them, then obviously they will not exist. You can quickly refresh en masse all .opf files for a particular Library using the calibredb utility. Refer to the online user manual for calibredb.
If a standard Identifier such as ISBN does not work for you, perhaps your own new personal UUID-like value in a Custom Column might work except for possibly when you "merge" books and the source and target books have different personal identifiers. You control that. You would also have to ensure that your personal Custom Column exists in all of your Libraries so a book's identifying value is not "lost" when copying or moving.
DaltonST