Skip to content

Commit

Permalink
immediate break in reuploading if using approved host
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Aug 25, 2024
1 parent c8218f0 commit 9351548
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/trackers/MTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ async def upload_with_retry(self, meta, cookiefile, common, img_host_index=1):
# Call handle_image_upload and pass the updated meta with the current image host index
image_list, retry_mode = await self.handle_image_upload(meta, img_host_index, approved_image_hosts)

# If retry_mode is True, switch to the next host
if retry_mode:
console.print(f"[yellow]Switching to the next image host. Current index: {img_host_index}")
img_host_index += 1
continue

# If we successfully uploaded images, break out of the loop
if image_list is not None:
# If we successfully uploaded images or are already using an approved host, break out of the loop
if not retry_mode:
break

if image_list is None:
# If retry_mode is True, switch to the next host
console.print(f"[yellow]Switching to the next image host. Current index: {img_host_index}")
img_host_index += 1

if not image_list:
console.print("[red]All image hosts failed. Please check your configuration.")
return

Expand Down

0 comments on commit 9351548

Please sign in to comment.