From e313a72ec1776314f6402c4dcdcddb89ca07c4f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Jul 2011 15:53:29 -0600 Subject: [PATCH] When converting in the GUI, set all identifiers in the metadata in the output file, if the output file supports them. --- src/calibre/ebooks/oeb/transforms/metadata.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/metadata.py b/src/calibre/ebooks/oeb/transforms/metadata.py index f719ee3eb5..0db24dd2ad 100644 --- a/src/calibre/ebooks/oeb/transforms/metadata.py +++ b/src/calibre/ebooks/oeb/transforms/metadata.py @@ -47,15 +47,19 @@ def meta_info_to_oeb_metadata(mi, m, log, override_input_metadata=False): m.add('series', mi.series) elif override_input_metadata: m.clear('series') - if not mi.is_null('isbn'): + identifiers = mi.get_identifiers() + set_isbn = False + for typ, val in identifiers.iteritems(): has = False + if typ.lower() == 'isbn': + set_isbn = True for x in m.identifier: - if x.scheme.lower() == 'isbn': - x.content = mi.isbn + if x.scheme.lower() == typ.lower(): + x.content = val has = True if not has: - m.add('identifier', mi.isbn, scheme='ISBN') - elif override_input_metadata: + m.add('identifier', val, scheme=typ.upper()) + if override_input_metadata and not set_isbn: m.filter('identifier', lambda x: x.scheme.lower() == 'isbn') if not mi.is_null('language'): m.clear('language')