mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
Changed backup snackbar to display the absolute path of the backup file
This commit is contained in:
parent
5c59400a5d
commit
6a8b0f1bb4
@ -26,14 +26,14 @@ async def export_database(data: BackupJob):
|
|||||||
""" Returns this weeks meal plan """
|
""" Returns this weeks meal plan """
|
||||||
|
|
||||||
try:
|
try:
|
||||||
export_db(data.tag, data.template)
|
export_path = export_db(data.tag, data.template)
|
||||||
except:
|
except:
|
||||||
HTTPException(
|
HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail=SnackResponse.error("Error Creating Backup. See Log File"),
|
detail=SnackResponse.error("Error Creating Backup. See Log File"),
|
||||||
)
|
)
|
||||||
|
|
||||||
return SnackResponse.success("Backup Created in /data/backups")
|
return SnackResponse.success("Backup Created at " + export_path)
|
||||||
|
|
||||||
|
|
||||||
@router.post(
|
@router.post(
|
||||||
|
@ -56,7 +56,7 @@ def import_from_archive(file_name: str) -> list:
|
|||||||
return successful_imports
|
return successful_imports
|
||||||
|
|
||||||
|
|
||||||
def export_db(tag=None, template=None):
|
def export_db(tag=None, template=None) -> str:
|
||||||
if tag:
|
if tag:
|
||||||
export_tag = tag + "_" + datetime.now().strftime("%Y-%b-%d")
|
export_tag = tag + "_" + datetime.now().strftime("%Y-%b-%d")
|
||||||
else:
|
else:
|
||||||
@ -80,6 +80,8 @@ def export_db(tag=None, template=None):
|
|||||||
shutil.rmtree(backup_folder)
|
shutil.rmtree(backup_folder)
|
||||||
shutil.rmtree(TEMP_DIR)
|
shutil.rmtree(TEMP_DIR)
|
||||||
|
|
||||||
|
return str(zip_path.absolute()) + ".zip"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def export_images(dest_dir) -> Path:
|
def export_images(dest_dir) -> Path:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user