From 13e29a05a3143c08778792a0645f2448ae1bb659 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 26 Sep 2012 18:28:26 +0530 Subject: [PATCH] EPUB metadata: Fix book producer not being set when updating EPUB metadata --- src/calibre/ebooks/metadata/opf2.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index cdd05ee430..3e5d95f1ce 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -1017,9 +1017,8 @@ class OPF(object): # {{{ def fset(self, val): matches = self.bkp_path(self.metadata) if not matches: - attrib = {'{%s}role'%self.NAMESPACES['opf']: 'bkp'} - matches = [self.create_metadata_element('contributor', - attrib=attrib)] + matches = [self.create_metadata_element('contributor')] + matches[0].set('{%s}role'%self.NAMESPACES['opf'], 'bkp') self.set_text(matches[0], unicode(val)) return property(fget=fget, fset=fset) @@ -1152,7 +1151,7 @@ class OPF(object): # {{{ def smart_update(self, mi, replace_metadata=False): for attr in ('title', 'authors', 'author_sort', 'title_sort', 'publisher', 'series', 'series_index', 'rating', - 'isbn', 'tags', 'category', 'comments', + 'isbn', 'tags', 'category', 'comments', 'book_producer', 'pubdate', 'user_categories', 'author_link_map'): val = getattr(mi, attr, None) if val is not None and val != [] and val != (None, None):