mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #2617 (Epub output doesn't use DB Metadata/Cover, uses whatever is in source file)
This commit is contained in:
parent
fb2296beb2
commit
a2a8edb1f5
@ -228,7 +228,7 @@ class Config(ResizableDialog, Ui_Dialog):
|
||||
return
|
||||
x = w.commit(save_defaults=False)
|
||||
recs.update(x)
|
||||
self.opf_path, self.cover_path = self.mw.opf_file, self.mw.cover_file
|
||||
self.opf_file, self.cover_file = self.mw.opf_file, self.mw.cover_file
|
||||
self._recommendations = recs
|
||||
if self.db is not None:
|
||||
recs['gui_preferred_input_format'] = self.input_format
|
||||
|
@ -48,12 +48,21 @@ def convert_single_ebook(parent, db, book_ids, auto_conversion=False, out_format
|
||||
out_file = PersistentTemporaryFile('.' + d.output_format)
|
||||
out_file.write(d.output_format)
|
||||
out_file.close()
|
||||
temp_files = []
|
||||
|
||||
desc = _('Convert book %d of %d (%s)') % (i + 1, total, repr(mi.title))
|
||||
|
||||
recs = cPickle.loads(d.recommendations)
|
||||
args = [in_file, out_file.name, recs]
|
||||
temp_files = [out_file]
|
||||
if d.opf_file is not None:
|
||||
recs.append(('read_metadata_from_opf', d.opf_file.name,
|
||||
OptionRecommendation.HIGH))
|
||||
temp_files.append(d.opf_file)
|
||||
if d.cover_file is not None:
|
||||
recs.append(('cover', d.cover_file.name,
|
||||
OptionRecommendation.HIGH))
|
||||
temp_files.append(d.cover_file)
|
||||
temp_files.append(out_file)
|
||||
jobs.append(('gui_convert', args, desc, d.output_format.upper(), book_id, temp_files))
|
||||
|
||||
changed = True
|
||||
@ -104,11 +113,21 @@ def convert_bulk_ebook(parent, db, book_ids, out_format=None):
|
||||
out_file = PersistentTemporaryFile('.' + output_format)
|
||||
out_file.write(output_format)
|
||||
out_file.close()
|
||||
temp_files = []
|
||||
|
||||
if d.opf_file is not None:
|
||||
recs.append(('read_metadata_from_opf', d.opf_file.name,
|
||||
OptionRecommendation.HIGH))
|
||||
temp_files.append(d.opf_file)
|
||||
if d.cover_file is not None:
|
||||
recs.append(('cover', d.cover_file.name,
|
||||
OptionRecommendation.HIGH))
|
||||
temp_files.append(d.cover_file)
|
||||
|
||||
desc = _('Convert book %d of %d (%s)') % (i + 1, total, repr(mi.title))
|
||||
|
||||
args = [in_file, out_file.name, recs]
|
||||
temp_files = [out_file]
|
||||
temp_files.append(out_file)
|
||||
jobs.append(('gui_convert', args, desc, d.output_format.upper(), book_id, temp_files))
|
||||
|
||||
changed = True
|
||||
|
@ -190,6 +190,10 @@ class Document(QWebPage):
|
||||
def animated_scroll_done(self):
|
||||
self.emit(SIGNAL('animated_scroll_done()'))
|
||||
|
||||
@pyqtSignature("QString")
|
||||
def debug(self, msg):
|
||||
prints(msg)
|
||||
|
||||
def reference_mode(self, enable):
|
||||
self.javascript(('enter' if enable else 'leave')+'_reference_mode()')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user