From 204807add61486c83e8568c29248e451aa630d1f Mon Sep 17 00:00:00 2001 From: David Lynch Date: Wed, 4 Dec 2024 17:20:11 -0600 Subject: [PATCH] Don't hardcode a story ID into a path before it's needed --- ebook/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebook/__init__.py b/ebook/__init__.py index 17c2574..077b5b6 100644 --- a/ebook/__init__.py +++ b/ebook/__init__.py @@ -121,7 +121,7 @@ def chapter_html( always_convert=image_options.get('always_convert_images') ) 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], content_type=img_contents[2] )) @@ -162,7 +162,7 @@ def chapter_html( break else: 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: chapters.append(EpubFile(title="Footnotes", path=f'{story.id}/footnotes.html', contents=html_template.format( title="Footnotes", text='\n\n'.join(story.footnotes))))