From 8428110d671570eec2caf81182c04f07c5410b29 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 5 Feb 2021 13:30:26 -0600 Subject: [PATCH] Don't count continue_on_chapter_error chapters when checking vs 'new chapters'. --- fanficfare/epubutils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fanficfare/epubutils.py b/fanficfare/epubutils.py index ce616651..c12ee401 100644 --- a/fanficfare/epubutils.py +++ b/fanficfare/epubutils.py @@ -25,7 +25,8 @@ def get_dcsource(inputio): return get_update_data(inputio,getfilecount=False,getsoups=False)[0] def get_dcsource_chaptercount(inputio): - return get_update_data(inputio,getfilecount=True,getsoups=False)[:2] # (source,filecount) + ## getsoups=True to check for continue_on_chapter_error chapters. + return get_update_data(inputio,getfilecount=True,getsoups=True)[:2] # (source,filecount) def get_cover_data(inputio): # (oldcoverhtmlhref,oldcoverhtmltype,oldcoverhtmldata,oldcoverimghref,oldcoverimgtype,oldcoverimgdata) @@ -165,6 +166,10 @@ def get_update_data(inputio, currenturl = None chapurl = soup.find('meta',{'name':'chapterurl'}) if chapurl: + logger.debug("chapurl['content']:%s"%chapurl['content']) + if chapurl['content'] == "chapter url removed due to failure": + # don't count/include continue_on_chapter_error chapters. + continue if chapurl['content'] not in urlsoups: # keep first found if more than one. # print("Found chapurl['content']:%s"%chapurl['content']) currenturl = chapurl['content']