From 7667b177d86cde5f9244dd51641c35db359f7967 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 Mar 2019 08:37:09 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/copy_to_library.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/actions/copy_to_library.py b/src/calibre/gui2/actions/copy_to_library.py index b9ef0d644f..32da577640 100644 --- a/src/calibre/gui2/actions/copy_to_library.py +++ b/src/calibre/gui2/actions/copy_to_library.py @@ -499,17 +499,16 @@ class CopyToLibraryAction(InterfaceAction): 'controlled by the Auto-merge option in ' 'Preferences->Import/export->Adding books.'), det_msg=books, 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 ci = v.currentIndex() row = None if ci.isValid(): row = ci.row() - v.model().delete_books_by_id(self.worker.processed, - permanent=True) - self.gui.iactions['Remove Books'].library_ids_deleted( - self.worker.processed, row) + v.model().delete_books_by_id(done_ids, permanent=True) + self.gui.iactions['Remove Books'].library_ids_deleted(done_ids, row) if self.worker.failed_books: def fmt_err(book_id):