From 54409dd08369e36c5496f00d5b211bb8546e6b3b Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 4 Jun 2020 17:26:41 -0500 Subject: [PATCH] Fix for collision issue with translations and email direct d/l. --- calibre-plugin/fff_plugin.py | 5 +++-- calibre-plugin/jobs.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py index 5624579ac..43e5448bc 100644 --- a/calibre-plugin/fff_plugin.py +++ b/calibre-plugin/fff_plugin.py @@ -104,7 +104,7 @@ LoopProgressDialog, UserPassDialog, AboutDialog, CollectURLDialog, RejectListDialog, EmailPassDialog, OVERWRITE, OVERWRITEALWAYS, UPDATE, UPDATEALWAYS, ADDNEW, SKIP, CALIBREONLY, - CALIBREONLYSAVECOL, + CALIBREONLYSAVECOL, save_collisions, NotGoingToDownload, RejectUrlEntry ) # because calibre immediately transforms html into zip and don't want @@ -515,7 +515,8 @@ def get_urls_from_imap_menu(self): if url_list: self.prep_downloads({ 'fileform': prefs['fileform'], - 'collision': prefs['collision'], + # save_collisions==convert from save value to local lang value + 'collision': save_collisions[prefs['collision']], 'updatemeta': prefs['updatemeta'], 'bgmeta': False, 'updateepubcover': prefs['updateepubcover'], diff --git a/calibre-plugin/jobs.py b/calibre-plugin/jobs.py index 1ce86b437..a63e29f03 100644 --- a/calibre-plugin/jobs.py +++ b/calibre-plugin/jobs.py @@ -302,6 +302,10 @@ def do_download_for_worker(book,options,merge,notification=lambda x,y:x): book['all_metadata'] = story.getAllMetadata(removeallentities=True) if options['savemetacol'] != '': book['savemetacol'] = story.dump_html_metadata() + else: + ## Shouldn't ever get here, but hey, it happened once + ## before with prefs['collision'] + raise Exception("Impossible state reached -- Book: %s:\nOptions:%s:"%(book,options)) if options['do_wordcount'] == SAVE_YES or ( options['do_wordcount'] == SAVE_YES_UNLESS_SITE and not story.getMetadataRaw('numWords') ):