Merge branch 'main' into zdy

This commit is contained in:
David Chang
2024-01-11 23:02:00 +08:00
39 changed files with 580 additions and 282 deletions

View File

@@ -360,8 +360,7 @@ def get_wallpaper():
if wallpaper_path:
try:
# Ensure the filename is secure
filename = secure_filename(os.path.basename(wallpaper_path))
return send_file(wallpaper_path, attachment_filename=filename)
return send_file(wallpaper_path, mimetype='image/png')
except Exception as e:
app.logger.error(f"An error occurred while serving the wallpaper file: {e}")
abort(500, description="Unable to serve the wallpaper file")