From 0768e046eb2efaa2bd52e41754bb0e0557798984 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Sep 2023 22:13:22 +0530 Subject: [PATCH] Fix #2036993 [Unhandled exception error when removing books](https://bugs.launchpad.net/calibre/+bug/2036993) --- src/calibre/db/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 3d16672a42..bdd5214026 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -1901,7 +1901,8 @@ class Cache: self.fields['size'].table.update_sizes(size_map) for book_id, fmts in iteritems(formats_map): - run_plugins_on_postdelete(self, book_id, fmt) + for fmt in fmts: + run_plugins_on_postdelete(self, book_id, fmt) self._update_last_modified(tuple(formats_map)) self.event_dispatcher(EventType.formats_removed, formats_map)