From bedaec99896670fca1f28901ca1b8fb7ed692b17 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Wed, 4 Dec 2024 16:51:21 -0600 Subject: [PATCH] Avoid potential image overlaps with nested sections --- ebook/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebook/__init__.py b/ebook/__init__.py index 507e876..964c4fa 100644 --- a/ebook/__init__.py +++ b/ebook/__init__.py @@ -114,11 +114,11 @@ def chapter_html( if img['src'] not in already_fetched_images: img_contents = get_image_from_url(img['src'], image_format, compress_images, max_image_size, always_convert_images) chapter.images.append(Image( - path=f"images/ch{i}_leechimage_{count}.{img_contents[1]}", + path=f"{story.id}/images/ch{i}_leechimage_{count}.{img_contents[1]}", contents=img_contents[0], content_type=img_contents[2] )) - already_fetched_images[img['src']] = f"../images/ch{i}_leechimage_{count}.{img_contents[1]}" + already_fetched_images[img['src']] = f"images/ch{i}_leechimage_{count}.{img_contents[1]}" else: print(img['src'], "(already", already_fetched_images.get(img['src']), ")")