mirror of
https://github.com/kemayo/leech
synced 2026-01-08 16:48:24 +01:00
Better fallback for no-title case on chapters
This commit is contained in:
parent
f17b040f64
commit
8f8d7b1edd
1 changed files with 3 additions and 2 deletions
|
|
@ -74,11 +74,12 @@ class CoverOptions:
|
|||
def chapter_html(story, titleprefix=None):
|
||||
chapters = []
|
||||
for i, chapter in enumerate(story):
|
||||
title = chapter.title or '#{}'.format(i)
|
||||
if hasattr(chapter, '__iter__'):
|
||||
# This is a Section
|
||||
chapters.extend(chapter_html(chapter, titleprefix=chapter.title))
|
||||
chapters.extend(chapter_html(chapter, titleprefix=title))
|
||||
else:
|
||||
title = titleprefix and '{}: {}'.format(titleprefix, chapter.title) or chapter.title
|
||||
title = titleprefix and '{}: {}'.format(titleprefix, title) or title
|
||||
chapters.append((
|
||||
title,
|
||||
'{}/chapter{}.html'.format(story.id, i + 1),
|
||||
|
|
|
|||
Loading…
Reference in a new issue