invalidate cache on media operations
This commit is contained in:
parent
2bf6776931
commit
f23d463a1a
|
|
@ -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,6 +862,7 @@ 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}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue