From eba91eaf65e6b772fbefe18d6058e6c7c60b0edd Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 16 Feb 2021 15:24:18 -0600 Subject: [PATCH] Fix for browser_cache with bgmeta. --- calibre-plugin/fff_plugin.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py index 7dfb6366..5c9f9300 100644 --- a/calibre-plugin/fff_plugin.py +++ b/calibre-plugin/fff_plugin.py @@ -1700,10 +1700,15 @@ class FanFicFarePlugin(InterfaceAction): ## save and pass cookiejar and caches to BG downloads. if 'browser_cache' in options: - browser_cachefile = PersistentTemporaryFile(suffix='.browser_cache', - dir=options['tdir']) - options['browser_cache'].save_cache(browser_cachefile.name) - options['browser_cachefile'] = browser_cachefile.name + if not options['bgmeta']: + ## With load-on-demand, the cache exists, but hasn't + ## been loaded. Once it is (file)loaded in jobs, it's + ## marked as having been 'loaded'. So don't send when + ## bgmeta + browser_cachefile = PersistentTemporaryFile(suffix='.browser_cache', + dir=options['tdir']) + options['browser_cache'].save_cache(browser_cachefile.name) + options['browser_cachefile'] = browser_cachefile.name ## can't be pickled by Calibre to send to BG proc del options['browser_cache']