diff --git a/README.md b/README.md index d718665..2d9be12 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Theme Song Booth -**Version:** `v0.5.0` +**Version:** `v0.5.1` A Flask web application for running a convention booth where visitors request a custom AI-generated theme song. Operators manage the queue from an admin dashboard, generate Suno prompts, upload MP3 previews, collect payment, and deliver final songs by email. diff --git a/VERSION b/VERSION index 8f0916f..4b9fcbe 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0 +0.5.1 diff --git a/app.py b/app.py index 4bc1d56..4f15ff8 100644 --- a/app.py +++ b/app.py @@ -1126,6 +1126,42 @@ def admin_request(rid): ) flash('Prompt saved.', 'success') + elif action == 'delete_songs': + # Remove selected uploaded MP3s and reset status so new songs can be uploaded. + to_delete = request.form.getlist('delete_song') + if not to_delete: + flash('Select at least one song to delete.', 'error') + return redirect(url_for('admin_request', rid=rid)) + + update_fields = {} + for version in to_delete: + if version == 'a': + path = req.get('song_a_path') + if path and Path(path).exists(): + try: + Path(path).unlink() + except OSError: + pass + update_fields['song_a_path'] = None + elif version == 'b': + path = req.get('song_b_path') + if path and Path(path).exists(): + try: + Path(path).unlink() + except OSError: + pass + update_fields['song_b_path'] = None + + if update_fields: + # Wipe any prior customer approval because the old files are gone. + update_fields['customer_approved'] = 'none' + # Reset to prompt_ready since songs need to be uploaded again. + update_fields['status'] = 'prompt_ready' + update_request(rid, **update_fields) + flash('Selected songs deleted. Request reset to Prompt Ready.', 'success') + else: + flash('No uploaded songs selected for deletion.', 'error') + elif action == 'upload_songs': # Save uploaded MP3 files for Version A and/or Version B. # Use the saved Suno title as the MP3 title tag if available. diff --git a/templates/admin/request.html b/templates/admin/request.html index 3529d84..9467e46 100644 --- a/templates/admin/request.html +++ b/templates/admin/request.html @@ -325,22 +325,36 @@

2. Upload Songs

-

- Version A: - {% if req.song_a_path and file_exists(req.song_a_path) %} - ✅ Uploaded {{ basename(req.song_a_path) }} - {% else %} - ❌ Not uploaded - {% endif %} -

-

- Version B: - {% if req.song_b_path and file_exists(req.song_b_path) %} - ✅ Uploaded {{ basename(req.song_b_path) }} - {% else %} - ❌ Not uploaded - {% endif %} -

+
+ +

+ + +

+

+ + +

+
+ +
+
+ +