Mobileread
UUID creation?
#1  Turtle91 05-23-2013, 09:34 AM
I use a template when creating new ePubs - all the standard Cover/Title/CSS/OPF files already in a "default.epub" file which then gets Saved-As the new title. Everything has been going great until I realized that I've been forgetting to change the UUID in the OPF!

Code
<dc:identifier id="BookId" opf:scheme="UUID">
urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</dc:identifier>
Is there some magic formula or scheme that should be followed when creating a new UUID?

And, more importantly, does Sigil have a function for doing that? If not, can it be added??
Reply 

#2  DiapDealer 05-23-2013, 09:55 AM
Quote Turtle91
Is there some magic formula or scheme that should be followed when creating a new UUID?
Depends on what kind of Unique ID you want to create. Random urn? ISBN? Your own custom scheme?

Quote
And, more importantly, does Sigil have a function for doing that?
No (except when opening a new blank epub). The only way to get Sigil to generate a new urn:uuid (that I know of) is to completely remove the <dc:identifier></dc:identifier> entry from the opf file. Unfortunately, this also has the rather unfortunate side effect of Sigil believing your opf is broken--so it creates a new opf from scratch. Something you definitely don't want happening.
Reply 

#3  PeterT 05-23-2013, 10:03 AM
http://www.famkruithof.net/uuid/uuidgen might be of use.
Reply 

#4  Turtle91 05-23-2013, 10:21 AM
@PeterT: Thanks! At least I now have 500 UUID's to hold me over!

@Diap: I was thinking a random ID... but the idea is to keep them unique. The link Peter posted uses a time stamp combined with a code based on his network gear?? I would think something along these lines would be very simple to incorporate into Sigil - a button in the metadata editor or something - especially since it already has the functionality to generate the code - we just need to tell it to do it.
Reply 

#5  roger64 05-23-2013, 10:51 AM
Hi

There is a Linux standard command line tool called, what else?, uuidgen.
uuidgen.png 
Reply 

#6  Jellby 05-23-2013, 12:51 PM
I simply use Jellby:YYYYMMDDx

where YYYYMMDD is the date of creation, and x is a letter I add if I create more than one a single day.
Reply 

#7  Turtle91 05-23-2013, 02:13 PM
Quote Jellby
I simply use Jellby:YYYYMMDDx

where YYYYMMDD is the date of creation, and x is a letter I add if I create more than one a single day.
lol...I didn't realize it could be that simple. I thought it had to follow that 8-4-4-4-12 format.

Although, aren't you worried there might be another Jellby out there doing the same thing - thus making the ID non-unique??!!??
Reply 

#8  st_albert 05-23-2013, 02:13 PM
Out of curiosity, what would be the consequences if there were two separate epubs with the same identical UUID? Under what circumstances would the collision be detected?
Reply 

#9  Turtle91 05-23-2013, 02:20 PM
I found it when I was using the firefox plugin ePubReader to read my books. When I added the second book (and the third, fourth, fifth etc.) with a UUID of a book that was already in the catalog, it would delete the first book and replace it with the new one...thinking it was an updated version of the same book.

I haven't had that issue with the limited number of other readers I've tried, but it seems like it could cause a problem.
Reply 

#10  mrmikel 05-24-2013, 07:56 AM
Quote Turtle91
I found it when I was using the firefox plugin ePubReader to read my books. When I added the second book (and the third, fourth, fifth etc.) with a UUID of a book that was already in the catalog, it would delete the first book and replace it with the new one...thinking it was an updated version of the same book.

I haven't had that issue with the limited number of other readers I've tried, but it seems like it could cause a problem.
It ought to be reported as a bug, so that the developer can throw a dialog box in there asking if it is the same and the other should be deleted. It may only be deleted from its own internal index, but still....
Reply 

  Next »  Last »  (1/9)
Today's Posts | Search this Thread | Login | Register