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):
|
def get_metadata(self):
|
||||||
title, authors = self.get_title_and_authors()
|
title, authors = self.get_title_and_authors()
|
||||||
mi = MetaInformation(title, authors)
|
mi = MetaInformation(title, authors)
|
||||||
publisher = unicode(self.publisher.text())
|
publisher = unicode(self.publisher.text()).strip()
|
||||||
if publisher:
|
if publisher:
|
||||||
mi.publisher = publisher
|
mi.publisher = publisher
|
||||||
author_sort = unicode(self.author_sort.text())
|
author_sort = unicode(self.author_sort.text()).strip()
|
||||||
if author_sort:
|
if author_sort:
|
||||||
mi.author_sort = author_sort
|
mi.author_sort = author_sort
|
||||||
comments = unicode(self.comment.toPlainText())
|
comments = unicode(self.comment.toPlainText()).strip()
|
||||||
if comments:
|
if comments:
|
||||||
mi.comments = comments
|
mi.comments = comments
|
||||||
mi.series_index = int(self.series_index.value())
|
mi.series_index = int(self.series_index.value())
|
||||||
if self.series.currentIndex() > -1:
|
if self.series.currentIndex() > -1:
|
||||||
mi.series = unicode(self.series.currentText())
|
mi.series = unicode(self.series.currentText()).strip()
|
||||||
tags = [t.strip() for t in unicode(self.tags.text()).split(',')]
|
tags = [t.strip() for t in unicode(self.tags.text()).strip().split(',')]
|
||||||
if tags:
|
if tags:
|
||||||
mi.tags = tags
|
mi.tags = tags
|
||||||
|
|
||||||
@ -267,6 +267,7 @@ class Config(ResizableDialog, Ui_Dialog):
|
|||||||
).exec_()
|
).exec_()
|
||||||
return
|
return
|
||||||
mi = self.get_metadata()
|
mi = self.get_metadata()
|
||||||
|
self.user_mi = mi
|
||||||
self.read_settings()
|
self.read_settings()
|
||||||
self.cover_file = None
|
self.cover_file = None
|
||||||
if self.row is not None:
|
if self.row is not None:
|
||||||
|
@ -157,10 +157,11 @@ def convert_bulk(fmt, parent, db, comics, others):
|
|||||||
if others:
|
if others:
|
||||||
d = get_dialog(fmt)(parent, db)
|
d = get_dialog(fmt)(parent, db)
|
||||||
if d.exec_() != QDialog.Accepted:
|
if d.exec_() != QDialog.Accepted:
|
||||||
others = []
|
others, user_mi = [], None
|
||||||
else:
|
else:
|
||||||
opts = d.opts
|
opts = d.opts
|
||||||
opts.verbose = 2
|
opts.verbose = 2
|
||||||
|
user_mi = d.user_mi
|
||||||
if comics:
|
if comics:
|
||||||
comic_opts = ComicConf.get_bulk_conversion_options(parent)
|
comic_opts = ComicConf.get_bulk_conversion_options(parent)
|
||||||
if not comic_opts:
|
if not comic_opts:
|
||||||
@ -188,6 +189,11 @@ def convert_bulk(fmt, parent, db, comics, others):
|
|||||||
continue
|
continue
|
||||||
options = opts.copy()
|
options = opts.copy()
|
||||||
mi = db.get_metadata(row)
|
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 = OPFCreator(os.getcwdu(), mi)
|
||||||
opf_file = PersistentTemporaryFile('.opf')
|
opf_file = PersistentTemporaryFile('.opf')
|
||||||
opf.render(opf_file)
|
opf.render(opf_file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user