diff --git a/coastsnap/spotteron_batch_download.py b/coastsnap/spotteron_batch_download.py index 17e7cb9..2a8681f 100644 --- a/coastsnap/spotteron_batch_download.py +++ b/coastsnap/spotteron_batch_download.py @@ -161,10 +161,16 @@ class Spotteron: if not images: logger.info("No images returned. Check correct root_id is supplied") + break - for img in images: - + for index, img in enumerate(images): + if img.exists(output_folder) and overwrite == False: + + if img.output_filename == images[index-1].output_filename: # Check for sequential duplicate images + logger.info(f"Duplicate Spotteron upload: {img.output_filename}") + continue + logger.info("Existing images found. Stopping getting images") break else: