Add vocal gender preference to customer request form and admin view

This commit is contained in:
Troll (Hermes Agent) 2026-08-01 21:20:11 +00:00
parent 0f6b68cf5d
commit 5b6012aa3d
4 changed files with 32 additions and 8 deletions

5
app.py
View file

@ -177,6 +177,7 @@ def request_form():
notable_facts=request.form.get('notable_facts', '').strip(),
style_genre=request.form.get('style_genre', '').strip(),
extra_requests=request.form.get('extra_requests', '').strip(),
vocal_gender=request.form.get('vocal_gender', '').strip(),
)
flash('Your request has been submitted! Check your email soon.', 'success')
return redirect(url_for('thanks', rid=rid))
@ -504,10 +505,10 @@ def admin_settings():
# Health check: verify expected columns exist.
expected_cols = {
'id', 'created_at', 'name', 'email', 'hobbies', 'notable_facts',
'style_genre', 'extra_requests', 'status', 'suno_title', 'suno_style',
'style_genre', 'extra_requests', 'vocal_gender', 'status', 'suno_title', 'suno_style',
'suno_lyrics', 'song_a_path', 'song_b_path', 'customer_approved',
'approval_notified_at', 'preview_sent_at', 'delivery_sent_at',
'square_payment_ref', 'admin_alert_email', 'player_token', 'revision_note'
'square_payment_ref', 'admin_alert_email', 'player_token', 'revision_note', 'revision_count'
}
health = {'ok': True, 'missing_columns': [], 'message': 'Database schema looks good.'}
try:

View file

@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS requests (
suno_lyrics TEXT,
song_a_path TEXT,
song_b_path TEXT,
vocal_gender TEXT,
customer_approved TEXT DEFAULT 'none',
approval_notified_at TIMESTAMP,
preview_sent_at TIMESTAMP,
@ -83,7 +84,7 @@ def now_utc():
return datetime.now(timezone.utc).isoformat()
def create_request(name, email, hobbies, notable_facts, style_genre, extra_requests):
def create_request(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender=None):
"""
Insert a new customer request.
Returns the auto-generated request id.
@ -91,9 +92,9 @@ def create_request(name, email, hobbies, notable_facts, style_genre, extra_reque
db = get_db()
cur = db.execute(
"""INSERT INTO requests
(name, email, hobbies, notable_facts, style_genre, extra_requests, player_token)
VALUES (?, ?, ?, ?, ?, ?, ?)""",
(name, email, hobbies, notable_facts, style_genre, extra_requests, new_token())
(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender, player_token)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
(name, email, hobbies, notable_facts, style_genre, extra_requests, vocal_gender, new_token())
)
db.commit()
return cur.lastrowid

View file

@ -140,6 +140,7 @@
<p><strong>Hobbies:</strong><br>{{ req.hobbies or '-' }}</p>
<p><strong>Notable facts:</strong><br>{{ req.notable_facts or '-' }}</p>
<p><strong>Style / genre:</strong><br>{{ req.style_genre or '-' }}</p>
<p><strong>Preferred singer voice / gender:</strong><br>{{ req.vocal_gender or 'No preference' }}</p>
<p><strong>Extra requests:</strong><br>{{ req.extra_requests or '-' }}</p>
{% if req.revision_note %}
@ -305,9 +306,10 @@
hobbies: {{ req.hobbies | tojson }},
notable_facts: {{ req.notable_facts | tojson }},
style_genre: {{ req.style_genre | tojson }},
vocal_gender: {{ req.vocal_gender | tojson }},
extra_requests: {{ req.extra_requests | tojson }}
};
const text = `Please write a Suno Custom Mode prompt for this customer. Suggest a song title too.\n\nCustomer data:\nName: ${data.name}\nHobbies: ${data.hobbies || '-'}\nNotable facts: ${data.notable_facts || '-'}\nStyle / genre: ${data.style_genre || '-'}\nExtra requests: ${data.extra_requests || '-'}\n\nReply with exactly this format:\n\nTitle: [suggested title]\n\nStyle:\n[the style description here]\n\nLyrics:\n[the lyrics here, with metatags]`;
const text = `Please write a Suno Custom Mode prompt for this customer. Suggest a song title too.\n\nCustomer data:\nName: ${data.name}\nHobbies: ${data.hobbies || '-'}\nNotable facts: ${data.notable_facts || '-'}\nStyle / genre: ${data.style_genre || '-'}\nPreferred singer voice / gender: ${data.vocal_gender || 'No preference'}\nExtra requests: ${data.extra_requests || '-'}\n\nReply with exactly this format:\n\nTitle: [suggested title]\n\nStyle:\n[the style description here]\n\nLyrics:\n[the lyrics here, with metatags]`;
navigator.clipboard.writeText(text).then(() => alert("Copied! Paste Hermes response into the Title, Style, and Lyrics fields."));
}

View file

@ -61,7 +61,17 @@
font:inherit;
margin-top:.25rem;
}
input:focus,textarea:focus{
select{
width:100%;
padding:.7rem;
border-radius:.5rem;
border:1px solid #374151;
background:#111827;
color:#f3f4f6;
font:inherit;
margin-top:.25rem;
}
input:focus,textarea:focus,select:focus{
outline:none;
border-color:#60a5fa;
box-shadow:0 0 0 3px rgba(96,165,250,.2);
@ -122,6 +132,16 @@
<label for="style_genre">Style / genre / mood</label>
<input type="text" id="style_genre" name="style_genre" placeholder="e.g. 80s power ballad, cinematic orchestral, lo-fi synthwave">
<label for="vocal_gender">Preferred singer voice / gender</label>
<select id="vocal_gender" name="vocal_gender">
<option value="" selected>No preference</option>
<option value="female">Female</option>
<option value="male">Male</option>
<option value="non-binary">Non-binary / Gender-neutral</option>
<option value="androgynous">Androgynous</option>
<option value="other">Other (mention in Extra Requests)</option>
</select>
<label for="extra_requests">Anything else you want in the song?</label>
<textarea id="extra_requests" name="extra_requests" placeholder="Specific lyrics, vibe, clean/explicit, vocal gender..."></textarea>