From f17af1c87593c0f6dfbaeed2d99c73f23d169c66 Mon Sep 17 00:00:00 2001 From: Audionut Date: Wed, 4 Dec 2024 20:09:36 +1000 Subject: [PATCH] Ugly abort if image host fail Prevent upload with no images --- src/prep.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/prep.py b/src/prep.py index 43a7916a..c00f1243 100644 --- a/src/prep.py +++ b/src/prep.py @@ -3033,6 +3033,10 @@ def upload_screens(self, meta, screens, img_host_num, i, total_screens, custom_i else: console.print(f"[yellow]Failed to upload: {result.get('reason', 'Unknown error')}") + if len(successfully_uploaded) < 3 and not retry_mode and img_host == initial_img_host and not using_custom_img_list: + console.print("[red]Less than 3 images were successfully uploaded. Aborting upload process.") + return + new_images = [] for upload in successfully_uploaded: raw_url = upload['raw_url']