mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
EPUB 2 metadata: Fix obfuscated fonts being broken when updating metadata if the file uses Adobe font obfuscation and the identifier with the key has an uppercase UUID scheme name. Fixes #1847890 [dc:identifier line being removed from content.opf](https://bugs.launchpad.net/calibre/+bug/1847890)
This commit is contained in:
parent
0bf8898ca4
commit
f38a7d15ba
@ -994,11 +994,11 @@ class OPF(object): # {{{
|
||||
self.metadata):
|
||||
xid = x.get('id', None)
|
||||
is_package_identifier = uuid_id is not None and uuid_id == xid
|
||||
typ = {val for attr, val in iteritems(x.attrib) if attr.endswith('scheme')}
|
||||
typ = {val.lower() for attr, val in iteritems(x.attrib) if attr.endswith('scheme')}
|
||||
if is_package_identifier:
|
||||
typ = tuple(typ)
|
||||
if typ and typ[0].lower() in identifiers:
|
||||
self.set_text(x, identifiers.pop(typ[0].lower()))
|
||||
if typ and typ[0] in identifiers:
|
||||
self.set_text(x, identifiers.pop(typ[0]))
|
||||
continue
|
||||
if typ and not (typ & {'calibre', 'uuid'}):
|
||||
x.getparent().remove(x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user