From 30929bc38ece148f0c3b9c344bdac20b1dbc7a43 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 24 Nov 2025 12:24:44 -0600 Subject: [PATCH] Better handling for no chapters found (#1283) --- fanficfare/story.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fanficfare/story.py b/fanficfare/story.py index 4c0e8129..dc2d069c 100644 --- a/fanficfare/story.py +++ b/fanficfare/story.py @@ -1056,7 +1056,11 @@ class Story(Requestable): def getChapterCount(self): ## returns chapter count adjusted for start-end range. - url_chapters = value = int(self.getMetadata("numChapters").replace(',','')) + value = 0 + try: + url_chapters = value = int(self.getMetadata("numChapters").replace(',','')) + except: + logger.warning("Failed to get number of chapters--no chapters recorded by adapter") if self.chapter_first: value = url_chapters - (int(self.chapter_first) - 1) if self.chapter_last: