WebashalarForML commited on
Commit
e49bd19
·
verified ·
1 Parent(s): 6836551

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -4023,6 +4023,13 @@ def download_sb3(project_id):
4023
  as_attachment=True, # This makes the browser download the file
4024
  download_name=sb3_filename # This sets the filename for the download
4025
  )
 
 
 
 
 
 
 
4026
  else:
4027
  logger.warning(f"SB3 file not found for ID: {project_id}")
4028
  return jsonify({"error": "Scratch project file not found"}), 404
 
4023
  as_attachment=True, # This makes the browser download the file
4024
  download_name=sb3_filename # This sets the filename for the download
4025
  )
4026
+ #sb3_path = create_sb3_archive(str(project_folder), project_id)
4027
+ return send_from_directory(
4028
+ directory=str(GEN_PROJECT_DIR),
4029
+ path=f"{project_id}.sb3",
4030
+ as_attachment=True,
4031
+ download_name=f"{project_id}.sb3",
4032
+ )
4033
  else:
4034
  logger.warning(f"SB3 file not found for ID: {project_id}")
4035
  return jsonify({"error": "Scratch project file not found"}), 404