Read calibre book uuid when reading metadata from MOBI files, needed for round-tripping to preserve the uuid when tweaking

This commit is contained in:
Kovid Goyal 2013-02-03 22:35:41 +05:30
parent a2a68d9fab
commit d661b15ae2

View File

@ -123,6 +123,12 @@ class EXTHHeader(object): # {{{
raw = check_isbn(content[len(isig):])
if raw and not self.mi.isbn:
self.mi.isbn = raw
elif content.startswith('calibre:'):
# calibre book uuid is stored here by recent calibre
# releases
cid = content[len('calibre:'):]
if cid:
self.mi.application_id = self.mi.uuid = cid
except:
pass
elif idx == 113: # ASIN or other id