From a3d5f9f5fb8941caf4bca30d0771ae5f5075d1cc Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 4 Jan 2015 17:05:00 -0600 Subject: [PATCH] Add option to call Count Pages Word Count only if FFDL numWords is missing. --- calibre-plugin/ffdl_plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index aa4539a8..dff86cb4 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1289,10 +1289,11 @@ class FanFictionDownLoaderPlugin(InterfaceAction): wc_ids = [ y['calibre_id'] for y in filter( lambda x : '' == x['all_metadata'].get('numWords',''), add_list + update_list ) ] ## not all need word count - if wc_ids and len(all_ids) != len(wc_ids): + if len(wc_ids) and len(all_ids) != len(wc_ids): cp_plugin.count_statistics(wc_ids,['WordCount']) - ## don't do WordCount below. - while 'WordCount' in countpagesstats: countpagesstats.remove('WordCount') + + ## don't do WordCount below. + while 'WordCount' in countpagesstats: countpagesstats.remove('WordCount') ## check that there's stuff to do in case wordcount was it. if countpagesstats: