mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 08:52:55 +01:00
Better handling for no chapters found (#1283)
This commit is contained in:
parent
ae4311f4dd
commit
30929bc38e
1 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue