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.
This commit is contained in:
Troll (Hermes Agent) 2026-08-05 17:44:11 +00:00
parent 3f7bbf4b12
commit da7dd0e9ee
3 changed files with 21 additions and 2 deletions

View file

@ -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.

View file

@ -1 +1 @@
0.4.7
0.4.8

19
app.py
View file

@ -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!",
"",