From 91b166b7442f6a9fcc6bea2e7ee872effa84813c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 Sep 2011 15:19:33 -0600 Subject: [PATCH] Content server: Update metadata when sending MOBI files --- src/calibre/library/server/content.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/server/content.py b/src/calibre/library/server/content.py index e55970ccd7..bb6fe1c454 100644 --- a/src/calibre/library/server/content.py +++ b/src/calibre/library/server/content.py @@ -202,7 +202,7 @@ class ContentServer(object): mode='rb') if fmt is None: raise cherrypy.HTTPError(404, 'book: %d does not have format: %s'%(id, format)) - mi = self.db.get_metadata(id, index_is_id=True) + mi = newmi = self.db.get_metadata(id, index_is_id=True) if format == 'EPUB': # Get the original metadata @@ -214,9 +214,8 @@ class ContentServer(object): # Transform the metadata via the plugboard newmi = mi.deepcopy_metadata() newmi.template_to_attribute(mi, cpb) - else: - newmi = mi + if format in ('MOBI', 'EPUB'): # Write the updated file from calibre.ebooks.metadata.meta import set_metadata set_metadata(fmt, newmi, 'epub')