Skip to content

Local AI BGM and sound effects for Claude Code and any MCP client. Stable Audio 3 on Apple Silicon (MLX) and Windows NVIDIA GPUs (PyTorch). No cloud, no API key.

Web UI: keep the server's message when no form field is to blame (GAME-240)

Kana0abbc4c0cf3a
diff --git a/src/audio_studio_mcp/static/app.js b/src/audio_studio_mcp/static/app.js
index d0f4abf..41c86f4 100644
--- a/src/audio_studio_mcp/static/app.js
+++ b/src/audio_studio_mcp/static/app.js
@@ -375,7 +375,9 @@ function clearErrors(f = form(), box = $("#form-error")) {
// Show an API error next to the form; mark the fields it names.
function showFormError(msg, fields, f = form(), box = $("#form-error"), adv = $("#advanced")) {
// the server's field messages are English; lead with a translated sentence
- if (fields && fields.length) msg = `${t("err.invalidFields")} (${fields.map((fe) => `${fe.field}: ${fe.message}`).join("; ")})`;
+ if (fields && fields.some((fe) => f.elements.namedItem(fe.field))) {
+ msg = `${t("err.invalidFields")} (${fields.map((fe) => `${fe.field}: ${fe.message}`).join("; ")})`;
+ }
box.textContent = msg; box.hidden = false;
for (const fe of fields || []) {
const input = f.elements.namedItem(fe.field);