mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2261 (Conversion metadata problem)
This commit is contained in:
parent
b52d7f60d9
commit
28a9c6868a
@ -176,19 +176,19 @@ class Config(ResizableDialog, Ui_Dialog):
|
||||
def get_metadata(self):
|
||||
title, authors = self.get_title_and_authors()
|
||||
mi = MetaInformation(title, authors)
|
||||
publisher = unicode(self.publisher.text())
|
||||
publisher = unicode(self.publisher.text()).strip()
|
||||
if publisher:
|
||||
mi.publisher = publisher
|
||||
author_sort = unicode(self.author_sort.text())
|
||||
author_sort = unicode(self.author_sort.text()).strip()
|
||||
if author_sort:
|
||||
mi.author_sort = author_sort
|
||||
comments = unicode(self.comment.toPlainText())
|
||||
comments = unicode(self.comment.toPlainText()).strip()
|
||||
if comments:
|
||||
mi.comments = comments
|
||||
mi.series_index = int(self.series_index.value())
|
||||
if self.series.currentIndex() > -1:
|
||||
mi.series = unicode(self.series.currentText())
|
||||
tags = [t.strip() for t in unicode(self.tags.text()).split(',')]
|
||||
mi.series = unicode(self.series.currentText()).strip()
|
||||
tags = [t.strip() for t in unicode(self.tags.text()).strip().split(',')]
|
||||
if tags:
|
||||
mi.tags = tags
|
||||
|
||||
@ -267,6 +267,7 @@ class Config(ResizableDialog, Ui_Dialog):
|
||||
).exec_()
|
||||
return
|
||||
mi = self.get_metadata()
|
||||
self.user_mi = mi
|
||||
self.read_settings()
|
||||
self.cover_file = None
|
||||
if self.row is not None:
|
||||
|
@ -157,10 +157,11 @@ def convert_bulk(fmt, parent, db, comics, others):
|
||||
if others:
|
||||
d = get_dialog(fmt)(parent, db)
|
||||
if d.exec_() != QDialog.Accepted:
|
||||
others = []
|
||||
others, user_mi = [], None
|
||||
else:
|
||||
opts = d.opts
|
||||
opts.verbose = 2
|
||||
user_mi = d.user_mi
|
||||
if comics:
|
||||
comic_opts = ComicConf.get_bulk_conversion_options(parent)
|
||||
if not comic_opts:
|
||||
@ -188,6 +189,11 @@ def convert_bulk(fmt, parent, db, comics, others):
|
||||
continue
|
||||
options = opts.copy()
|
||||
mi = db.get_metadata(row)
|
||||
if user_mi is not None:
|
||||
if user_mi.series_index == 1:
|
||||
user_mi.series_index = None
|
||||
mi.smart_update(user_mi)
|
||||
db.set_metadata(db.id(row), mi)
|
||||
opf = OPFCreator(os.getcwdu(), mi)
|
||||
opf_file = PersistentTemporaryFile('.opf')
|
||||
opf.render(opf_file)
|
||||
|
Loading…
x
Reference in New Issue
Block a user