mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When converting in the GUI, set all identifiers in the metadata in the output file, if the output file supports them.
This commit is contained in:
parent
aeca2b777d
commit
e313a72ec1
@ -47,15 +47,19 @@ def meta_info_to_oeb_metadata(mi, m, log, override_input_metadata=False):
|
|||||||
m.add('series', mi.series)
|
m.add('series', mi.series)
|
||||||
elif override_input_metadata:
|
elif override_input_metadata:
|
||||||
m.clear('series')
|
m.clear('series')
|
||||||
if not mi.is_null('isbn'):
|
identifiers = mi.get_identifiers()
|
||||||
|
set_isbn = False
|
||||||
|
for typ, val in identifiers.iteritems():
|
||||||
has = False
|
has = False
|
||||||
|
if typ.lower() == 'isbn':
|
||||||
|
set_isbn = True
|
||||||
for x in m.identifier:
|
for x in m.identifier:
|
||||||
if x.scheme.lower() == 'isbn':
|
if x.scheme.lower() == typ.lower():
|
||||||
x.content = mi.isbn
|
x.content = val
|
||||||
has = True
|
has = True
|
||||||
if not has:
|
if not has:
|
||||||
m.add('identifier', mi.isbn, scheme='ISBN')
|
m.add('identifier', val, scheme=typ.upper())
|
||||||
elif override_input_metadata:
|
if override_input_metadata and not set_isbn:
|
||||||
m.filter('identifier', lambda x: x.scheme.lower() == 'isbn')
|
m.filter('identifier', lambda x: x.scheme.lower() == 'isbn')
|
||||||
if not mi.is_null('language'):
|
if not mi.is_null('language'):
|
||||||
m.clear('language')
|
m.clear('language')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user