Skip to content

Commit

Permalink
Ugly abort if image host fail
Browse files Browse the repository at this point in the history
Prevent upload with no images
  • Loading branch information
Audionut committed Dec 4, 2024
1 parent 09e870f commit f17af1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit f17af1c

Please sign in to comment.