From 276c26ff266d964616bed0393da40dc7deba6440 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Oct 2020 08:32:30 +0530 Subject: [PATCH] Annotations browser: Fix regression that caused an error when searching. Fixes #1900463 [Annotation Browser: search error](https://bugs.launchpad.net/calibre/+bug/1900463) --- src/calibre/gui2/library/annotations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/library/annotations.py b/src/calibre/gui2/library/annotations.py index ce7b64d484..8080784766 100644 --- a/src/calibre/gui2/library/annotations.py +++ b/src/calibre/gui2/library/annotations.py @@ -481,10 +481,11 @@ class BrowsePanel(QWidget): ignore_removed=True, restrict_to_book_ids=q['restrict_to_book_ids'] or None ) else: + q2 = q.copy() + q2['restrict_to_book_ids'] = q.get('restrict_to_book_ids') or None results = db.search_annotations( highlight_start='\x1d', highlight_end='\x1d', snippet_size=64, - ignore_removed=True, restrict_to_book_ids=q['restrict_to_book_ids'] or None, - **q + ignore_removed=True, **q2 ) self.results_list.set_results(results, bool(q['fts_engine_query'])) self.current_query = q