mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add possibility of mobi and azw3 plugboards to the content server
This commit is contained in:
parent
79835a2922
commit
ed1d217bce
@ -20,7 +20,7 @@ from calibre.utils.filenames import ascii_filename
|
|||||||
from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
from calibre.ebooks.metadata.opf2 import metadata_to_opf
|
||||||
|
|
||||||
plugboard_content_server_value = 'content_server'
|
plugboard_content_server_value = 'content_server'
|
||||||
plugboard_content_server_formats = ['epub']
|
plugboard_content_server_formats = ['epub', 'mobi', 'azw3']
|
||||||
|
|
||||||
class CSSortKeyGenerator(SortKeyGenerator):
|
class CSSortKeyGenerator(SortKeyGenerator):
|
||||||
|
|
||||||
@ -224,13 +224,11 @@ class ContentServer(object):
|
|||||||
mt = 'application/octet-stream'
|
mt = 'application/octet-stream'
|
||||||
cherrypy.response.headers['Content-Type'] = mt
|
cherrypy.response.headers['Content-Type'] = mt
|
||||||
|
|
||||||
if format == 'EPUB':
|
if format.lower() in plugboard_content_server_formats:
|
||||||
# Get the original metadata
|
# Get any plugboards for the content server
|
||||||
|
|
||||||
# Get any EPUB plugboards for the content server
|
|
||||||
plugboards = self.db.prefs.get('plugboards', {})
|
plugboards = self.db.prefs.get('plugboards', {})
|
||||||
cpb = find_plugboard(plugboard_content_server_value,
|
cpb = find_plugboard(plugboard_content_server_value,
|
||||||
'epub', plugboards)
|
format.lower(), plugboards)
|
||||||
if cpb:
|
if cpb:
|
||||||
# Transform the metadata via the plugboard
|
# Transform the metadata via the plugboard
|
||||||
newmi = mi.deepcopy_metadata()
|
newmi = mi.deepcopy_metadata()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user