v0.8.7: update VERSION, README, and code comments

- VERSION bumped to 0.8.7
- README.md: comprehensive update with Gokapi integration, stems radio
  buttons, download button, cost tracking improvements, stepper fixes,
  error recovery, new env vars, new troubleshooting entries
- app.py: updated module docstring with all current routes
- helpers.py: updated module docstring with function group overview,
  added section header for Gokapi integration
- config.py: added Gokapi env vars to docstring
- models.py: updated schema comments for per-version costs and
  stems_link/stems_url distinction
This commit is contained in:
Troll (Hermes Agent) 2026-08-11 21:08:38 +00:00
parent 59d79cd03d
commit 8df735d88c
6 changed files with 119 additions and 40 deletions

39
app.py
View file

@ -1,7 +1,7 @@
"""
app.py
======
Main Flask application for the Theme Song Booth.
Main Flask application for the Theme Song Booth (MusicGPT Edition).
This module defines all HTTP routes, helper functions, the email layer,
runtime settings persistence, MP3 metadata tagging, rate limiting, and
@ -10,22 +10,31 @@ database health/maintenance helpers.
It is meant to be served by gunicorn inside a Docker container (see Dockerfile).
Public routes (customers):
- / -> redirects to /request
- /request -> customer submits their info
- /thanks/<id> -> confirmation page after submission
- /play/<token> -> private player page with Version A and B
- /play/<token>/approve -> customer picks a version
- /play/<token>/revise -> customer asks for changes
- /audio/<token>/<v>.mp3 -> serves the uploaded MP3 files
- / -> redirects to /request
- /request -> customer submits their info
- /thanks/<id> -> confirmation page after submission
- /play/<token> -> private player page with Version A and B
- /play/<token>/approve -> customer picks a version
- /play/<token>/revise -> customer asks for changes
- /api/stream/<token>/<v>.mp3 -> streams uploaded MP3s (requires both A and B)
- /api/audio-source/<token>/<v>.mp3 -> serves a single MP3 for stems extraction API
- /audio/<token>/<v>.mp3 -> legacy, returns 404
Admin routes:
- /admin/login -> password login
- /admin/logout -> clears session
- /admin -> dashboard queue with status filters and auto-refresh
- /admin/settings -> runtime settings, health check, DB stats, backup/restore, reset
- /admin/request/<id> -> detail/edit page for a single request
- /admin/request/<id>/delete -> deletes one request and its uploaded files
- /admin/reset -> deletes ALL requests and ALL files
- /admin/login -> password login
- /admin/logout -> clears session
- /admin -> dashboard queue with status filters and auto-refresh
- /admin/settings -> runtime settings, health check, DB stats, backup/restore, reset
- /admin/request/<id> -> detail/edit page for a single request
- /admin/request/<id>/delete -> deletes one request and its uploaded files
- /admin/request/<id>/download-stems -> downloads all stems as a zip archive
- /admin/reset -> deletes ALL requests and ALL files
API routes:
- /api/musicgpt/webhook -> MusicGPT async callback (generation + stems)
- /api/musicgpt/autopoll -> background poll for all in-flight tasks
- /api/prompt/<id> -> Hermes callback for generated prompts
- /api/key-test -> tests the Hermes API key
"""
# Standard library imports