mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix a regression in the previous release that broke Copy to library and delete after when copying a duplicated book. Fixes #1816224 [Bug when copying an existing book from one library to another](https://bugs.launchpad.net/calibre/+bug/1816224)
This commit is contained in:
parent
293571cb8a
commit
7667b177d8
@ -499,17 +499,16 @@ class CopyToLibraryAction(InterfaceAction):
|
|||||||
'controlled by the Auto-merge option in '
|
'controlled by the Auto-merge option in '
|
||||||
'Preferences->Import/export->Adding books.'), det_msg=books,
|
'Preferences->Import/export->Adding books.'), det_msg=books,
|
||||||
show=True)
|
show=True)
|
||||||
if delete_after and self.worker.processed:
|
done_ids = frozenset(self.worker.processed) - frozenset(self.worker.duplicate_ids)
|
||||||
|
if delete_after and done_ids:
|
||||||
v = self.gui.library_view
|
v = self.gui.library_view
|
||||||
ci = v.currentIndex()
|
ci = v.currentIndex()
|
||||||
row = None
|
row = None
|
||||||
if ci.isValid():
|
if ci.isValid():
|
||||||
row = ci.row()
|
row = ci.row()
|
||||||
|
|
||||||
v.model().delete_books_by_id(self.worker.processed,
|
v.model().delete_books_by_id(done_ids, permanent=True)
|
||||||
permanent=True)
|
self.gui.iactions['Remove Books'].library_ids_deleted(done_ids, row)
|
||||||
self.gui.iactions['Remove Books'].library_ids_deleted(
|
|
||||||
self.worker.processed, row)
|
|
||||||
|
|
||||||
if self.worker.failed_books:
|
if self.worker.failed_books:
|
||||||
def fmt_err(book_id):
|
def fmt_err(book_id):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user