diff --git a/backend/main.py b/backend/main.py index f9844eb..8b12b56 100644 --- a/backend/main.py +++ b/backend/main.py @@ -40,6 +40,7 @@ from .utils import ( rename_folder, delete_folder, save_uploaded_image, + _scan_cache_invalidate, validate_path_security, get_all_tags, get_notes_by_tag, @@ -861,7 +862,8 @@ async def move_media_endpoint(request: Request, data: dict): # Move the file import shutil shutil.move(str(old_full_path), str(new_full_path)) - + _scan_cache_invalidate() + return {"success": True, "message": "Media moved successfully", "newPath": new_path} except HTTPException: diff --git a/backend/utils.py b/backend/utils.py index 9f5e05f..b7e607d 100644 --- a/backend/utils.py +++ b/backend/utils.py @@ -735,6 +735,7 @@ def save_uploaded_image( try: with open(full_path, "wb") as f: f.write(file_data) + _scan_cache_invalidate() return str(full_path.relative_to(base).as_posix()) except OSError as e: logger.error("Error saving image: %s", e) @@ -754,6 +755,7 @@ def save_uploaded_image( try: with open(full_path, "wb") as f: f.write(file_data) + _scan_cache_invalidate() return str(full_path.relative_to(base).as_posix()) except OSError as e: logger.error("Error saving image: %s", e)