remove local storage of images
Browse files
app.py
CHANGED
@@ -219,16 +219,6 @@ def prepare_images(scientific_name: str):
|
|
219 |
if not scode:
|
220 |
return []
|
221 |
|
222 |
-
# Clear folder assets' images
|
223 |
-
for filename in os.listdir(ASSET_DIR):
|
224 |
-
# Construct full file path
|
225 |
-
file_path = os.path.join(ASSET_DIR, filename)
|
226 |
-
# Check if the file is a .jpg, .jpeg, or .png
|
227 |
-
if file_path.lower().endswith(('.jpg', '.jpeg', '.png')):
|
228 |
-
# If yes, delete the file
|
229 |
-
os.remove(file_path)
|
230 |
-
print(f"Deleted: {file_path}")
|
231 |
-
|
232 |
# Save images to assets
|
233 |
urls = download_images(f"https://ebird.org/species/{scode}")
|
234 |
|
|
|
219 |
if not scode:
|
220 |
return []
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
# Save images to assets
|
223 |
urls = download_images(f"https://ebird.org/species/{scode}")
|
224 |
|