previews and back to edit button
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m12s
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m12s
This commit is contained in:
14
app.py
14
app.py
@@ -211,6 +211,20 @@ def download_video(file_id):
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/preview/<file_id>')
|
||||
def preview_video(file_id):
|
||||
"""Serve processed video for inline preview"""
|
||||
try:
|
||||
output_filename = f"{file_id}_processed.mp4"
|
||||
output_path = os.path.join(app.config['OUTPUT_FOLDER'], output_filename)
|
||||
|
||||
if not os.path.exists(output_path):
|
||||
return jsonify({'error': 'File not found'}), 404
|
||||
|
||||
return send_file(output_path, mimetype='video/mp4')
|
||||
except Exception as e:
|
||||
return jsonify({'error': str(e)}), 500
|
||||
|
||||
@app.route('/cleanup/<file_id>', methods=['DELETE'])
|
||||
def cleanup_files(file_id):
|
||||
"""Clean up uploaded and processed files"""
|
||||
|
||||
Reference in New Issue
Block a user