From 68bb6f6fcf662b88d845b3b8442403bc6b0f5f80 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 22 May 2022 14:23:59 -0500 Subject: [PATCH] Don't set marked in Calibre when book_id is None #833 --- calibre-plugin/fff_plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py index 17dd7711..b3207e62 100644 --- a/calibre-plugin/fff_plugin.py +++ b/calibre-plugin/fff_plugin.py @@ -1775,6 +1775,9 @@ class FanFicFarePlugin(InterfaceAction): for index, book_id in enumerate(mark_anthology_ids): marked_ids[book_id] = '%s_anthology_%04d' % (marked_text, index) # Mark the results in our database + logger.debug("set_marked_ids:%s"%marked_ids) + if None in marked_ids: + del marked_ids[None] self.gui.current_db.set_marked_ids(marked_ids) # Search to display the list contents self.gui.search.set_search_string('marked:' + marked_text) @@ -1884,6 +1887,9 @@ class FanFicFarePlugin(InterfaceAction): marked_ids[book_id] = '%s_chapter_error_%04d' % (marked_text, index) # Mark the results in our database, even if none. + if None in marked_ids: + del marked_ids[None] + logger.debug("set_marked_ids:%s"%marked_ids) db.set_marked_ids(marked_ids) # only show if there are some. if marked_ids and prefs['showmarked']: # show add/update