From da7dd0e9ee255b84e74d6711ebbf2f2e717a345b Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Wed, 5 Aug 2026 17:44:11 +0000 Subject: [PATCH] Include lyrics in delivery email The final delivery email now appends a Song Lyrics section in the same format shown on the customer player page: section headers like [Chorus] are stripped, blank lines are preserved as stanza breaks, and the lyric lines are rendered as plain text. Bumps version to 0.4.8. --- README.md | 2 +- VERSION | 2 +- app.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d45394..250c989 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Theme Song Booth -**Version:** `v0.4.7` +**Version:** `v0.4.8` 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 f905682..cb498ab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.7 +0.4.8 diff --git a/app.py b/app.py index 04f184b..4bc1d56 100644 --- a/app.py +++ b/app.py @@ -1187,11 +1187,30 @@ def admin_request(rid): expiry_date = (datetime.utcnow() + timedelta(days=90)).strftime('%B %d, %Y') player_link = f"{current_app.config['PUBLIC_BASE_URL']}/play/{req['player_token']}" + + # Format lyrics the same way they appear on the customer player page: + # skip section headers like [Chorus] and blank lines, keep stanza breaks. + lyrics_section = '' + if req.get('suno_lyrics'): + lyric_lines = [] + for line in req['suno_lyrics'].splitlines(): + stripped = line.strip() + if stripped and not (stripped.startswith('[') and stripped.endswith(']')): + lyric_lines.append(stripped) + elif not stripped and lyric_lines and lyric_lines[-1] != '': + lyric_lines.append('') + if lyric_lines: + lyrics_section = '\n'.join(['', '---', 'Song Lyrics', '---', ''] + lyric_lines + ['']) + body_lines = [ f"Hi {req['name']},", "", "Thanks for your payment! Your selected song(s) are attached to this email.", f"You can also keep streaming them here: {player_link}", + ] + if lyrics_section: + body_lines.append(lyrics_section) + body_lines += [ "", "Enjoy!", "",