mirror of
https://github.com/kemayo/leech
synced 2025-12-06 08:22:56 +01:00
Don't hardcode a story ID into a path before it's needed
This commit is contained in:
parent
bb1fcc0e50
commit
204807add6
1 changed files with 2 additions and 2 deletions
|
|
@ -121,7 +121,7 @@ def chapter_html(
|
||||||
always_convert=image_options.get('always_convert_images')
|
always_convert=image_options.get('always_convert_images')
|
||||||
)
|
)
|
||||||
chapter.images.append(Image(
|
chapter.images.append(Image(
|
||||||
path=f"{story.id}/images/ch{i}_leechimage_{count}.{img_contents[1]}",
|
path=f"images/ch{i}_leechimage_{count}.{img_contents[1]}",
|
||||||
contents=img_contents[0],
|
contents=img_contents[0],
|
||||||
content_type=img_contents[2]
|
content_type=img_contents[2]
|
||||||
))
|
))
|
||||||
|
|
@ -162,7 +162,7 @@ def chapter_html(
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
chapters.append(EpubFile(
|
chapters.append(EpubFile(
|
||||||
path=image.path, contents=image.contents, filetype=image.content_type))
|
path=f'{story.id}/{image.path}', contents=image.contents, filetype=image.content_type))
|
||||||
if story.footnotes:
|
if story.footnotes:
|
||||||
chapters.append(EpubFile(title="Footnotes", path=f'{story.id}/footnotes.html', contents=html_template.format(
|
chapters.append(EpubFile(title="Footnotes", path=f'{story.id}/footnotes.html', contents=html_template.format(
|
||||||
title="Footnotes", text='\n\n'.join(story.footnotes))))
|
title="Footnotes", text='\n\n'.join(story.footnotes))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue