moved files
This commit is contained in:
15
src/main.py
15
src/main.py
@@ -544,6 +544,21 @@ class EditPopup(Popup):
|
||||
if response.status_code == 200:
|
||||
response_data = response.json()
|
||||
Logger.info(f"EditPopup: ✅ Successfully uploaded edited media to server: {response_data}")
|
||||
|
||||
# Delete local files after successful upload
|
||||
try:
|
||||
if os.path.exists(image_path):
|
||||
os.remove(image_path)
|
||||
Logger.info(f"EditPopup: Deleted local image file: {os.path.basename(image_path)}")
|
||||
|
||||
if os.path.exists(metadata_path):
|
||||
os.remove(metadata_path)
|
||||
Logger.info(f"EditPopup: Deleted local metadata file: {os.path.basename(metadata_path)}")
|
||||
|
||||
Logger.info("EditPopup: ✅ Local edited files cleaned up after successful upload")
|
||||
except Exception as e:
|
||||
Logger.warning(f"EditPopup: Could not delete local files: {e}")
|
||||
|
||||
return True
|
||||
elif response.status_code == 404:
|
||||
Logger.warning("EditPopup: ⚠️ Upload endpoint not available on server (404) - edited media saved locally only")
|
||||
|
||||
Reference in New Issue
Block a user