mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-26 23:36:09 +01:00
Adding books: When adding with auto-merge and auto-convert enabled, also run conversions for books into which the added files are merged. Fixes #1822018 [Does not auto-convert when adding existing book with overwrite selected](https://bugs.launchpad.net/calibre/+bug/1822018)
This commit is contained in:
parent
b0543d1bb5
commit
4ffffb143d
1 changed files with 3 additions and 1 deletions
|
|
@ -89,6 +89,7 @@ def __init__(self, source, single_book_per_directory=True, db=None, parent=None,
|
|||
self.report = []
|
||||
self.items = []
|
||||
self.added_book_ids = set()
|
||||
self.merged_formats_added_to = set()
|
||||
self.merged_books = set()
|
||||
self.added_duplicate_info = set()
|
||||
self.pd.show()
|
||||
|
|
@ -383,6 +384,7 @@ def merge_books(self, mi, cover_path, paths, identical_book_ids):
|
|||
ib_fmts = {fmt.upper() for fmt in self.db.formats(identical_book_id)}
|
||||
seen_fmts |= ib_fmts
|
||||
self.add_formats(identical_book_id, paths, mi, replace=replace)
|
||||
self.merged_formats_added_to.add(identical_book_id)
|
||||
if gprefs['automerge'] == 'new record':
|
||||
incoming_fmts = {path.rpartition(os.extsep)[-1].upper() for path in paths}
|
||||
if incoming_fmts.intersection(seen_fmts):
|
||||
|
|
@ -490,7 +492,7 @@ def finish(self):
|
|||
|
||||
if gprefs['manual_add_auto_convert'] and self.added_book_ids and self.parent() is not None:
|
||||
self.parent().iactions['Convert Books'].auto_convert_auto_add(
|
||||
self.added_book_ids)
|
||||
self.added_book_ids | self.merged_formats_added_to)
|
||||
|
||||
try:
|
||||
if callable(self.callback):
|
||||
|
|
|
|||
Loading…
Reference in a new issue