From ed1d217bced00f152a7a36c5b535582ff89facde Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 14 Mar 2013 08:52:38 +0100 Subject: [PATCH] Add possibility of mobi and azw3 plugboards to the content server --- src/calibre/library/server/content.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/calibre/library/server/content.py b/src/calibre/library/server/content.py index 6953deff5f..11a22bd859 100644 --- a/src/calibre/library/server/content.py +++ b/src/calibre/library/server/content.py @@ -20,7 +20,7 @@ from calibre.utils.filenames import ascii_filename from calibre.ebooks.metadata.opf2 import metadata_to_opf plugboard_content_server_value = 'content_server' -plugboard_content_server_formats = ['epub'] +plugboard_content_server_formats = ['epub', 'mobi', 'azw3'] class CSSortKeyGenerator(SortKeyGenerator): @@ -224,13 +224,11 @@ class ContentServer(object): mt = 'application/octet-stream' cherrypy.response.headers['Content-Type'] = mt - if format == 'EPUB': - # Get the original metadata - - # Get any EPUB plugboards for the content server + if format.lower() in plugboard_content_server_formats: + # Get any plugboards for the content server plugboards = self.db.prefs.get('plugboards', {}) cpb = find_plugboard(plugboard_content_server_value, - 'epub', plugboards) + format.lower(), plugboards) if cpb: # Transform the metadata via the plugboard newmi = mi.deepcopy_metadata()