Better handling for no chapters found (#1283)

This commit is contained in:
Jim Miller 2025-11-24 12:24:44 -06:00
parent ae4311f4dd
commit 30929bc38e

View file

@ -1056,7 +1056,11 @@ class Story(Requestable):
def getChapterCount(self): def getChapterCount(self):
## returns chapter count adjusted for start-end range. ## 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: if self.chapter_first:
value = url_chapters - (int(self.chapter_first) - 1) value = url_chapters - (int(self.chapter_first) - 1)
if self.chapter_last: if self.chapter_last: