From e859aa23bf7a692a4106e243684cad54bbd76204 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 9 Aug 2021 13:29:23 -0500 Subject: [PATCH] More 'correct' fix for missing URL on anthology update. Reverses fcf8dc2cde607f444fd0c743732f057e4c532c7c --- calibre-plugin/dialogs.py | 1 + calibre-plugin/fff_plugin.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 9f5123d6..4ed16f79 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -501,6 +501,7 @@ class AddNewDialog(SizePersistedDialog): retval['updatemeta']=True retval['collision']=ADDNEW + logger.debug("self.extraoptions['anthology_url']:%s"%self.extraoptions.get('anthology_url','NOT FOUND')) retval.update(self.extraoptions) return retval diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py index eaebc464..19a21c87 100644 --- a/calibre-plugin/fff_plugin.py +++ b/calibre-plugin/fff_plugin.py @@ -864,6 +864,7 @@ class FanFicFarePlugin(InterfaceAction): Both new individual stories and new anthologies are created here. Expected extraoptions entries: anthology_url, add_tag, frompage ''' + logger.debug("extraoptions['anthology_url']:%s"%extraoptions.get('anthology_url','NOT FOUND')) self.check_valid_collision(extraoptions) if not url_list_text: @@ -955,7 +956,8 @@ class FanFicFarePlugin(InterfaceAction): # and anthologies, and for updating existing anthologies. # make a copy before adding to avoid changing passed param eo = dict(extraoptions) - eo.update({'frompage':frompage, + eo.update({'anthology_url':mergebook['url'], + 'frompage':frompage, 'tdir':tdir, 'mergebook':mergebook}) self.add_new_dialog.show_dialog(url_list_text, @@ -2793,6 +2795,8 @@ class FanFicFarePlugin(InterfaceAction): serieslist=[] serieslists=[] + logger.debug("options['anthology_url']:%s"%options.get('anthology_url','NOT FOUND')) + # copy list top level for b in book_list: if b['series']: @@ -2904,8 +2908,6 @@ class FanFicFarePlugin(InterfaceAction): configuration = get_fff_config(book['url'],options['fileform']) if existingbook: - if 'url' in existingbook and existingbook['url']: - book['url'] = existingbook['url'] book['title'] = deftitle = existingbook['title'] if prefs['anth_comments_newonly']: book['comments'] = existingbook['comments']