diff --git a/public/scripts/extensions/audio/index.js b/public/scripts/extensions/audio/index.js index fed86fdd3..d082f1c3d 100644 --- a/public/scripts/extensions/audio/index.js +++ b/public/scripts/extensions/audio/index.js @@ -563,6 +563,17 @@ jQuery(async () => { $("#audio_bgm_cooldown").on("input", onBGMCooldownInput); + // Reset assets container, will be redected like if ST restarted + $("#audio_refresh_assets").on("click", function(){ + console.debug(DEBUG_PREFIX,"Refreshing audio assets"); + fallback_BGMS = null; + ambients = null; + characterMusics = {}; + currentCharacterBGM = null; + currentExpressionBGM = null; + currentBackground = null; + }) + // DBG $("#audio_debug").on("click", function () { if ($("#audio_debug").is(':checked')) { diff --git a/public/scripts/extensions/audio/style.css b/public/scripts/extensions/audio/style.css index 361386c71..97b3d42b4 100644 --- a/public/scripts/extensions/audio/style.css +++ b/public/scripts/extensions/audio/style.css @@ -14,4 +14,9 @@ .audio-mute-button-muted { color: red; +} + +#audio_refresh_assets { + width: 50px; + height: 30px; } \ No newline at end of file diff --git a/public/scripts/extensions/audio/window.html b/public/scripts/extensions/audio/window.html index c9eaf467c..7d5425aa7 100644 --- a/public/scripts/extensions/audio/window.html +++ b/public/scripts/extensions/audio/window.html @@ -16,6 +16,12 @@ Debug +
+ + +
diff --git a/server.js b/server.js index 58d5944df..33ae47a2b 100644 --- a/server.js +++ b/server.js @@ -5070,13 +5070,13 @@ app.post('/asset_download', jsonParser, async (request, response) => { const url = request.body.url; const inputCategory = request.body.category; const inputFilename = sanitize(request.body.filename); - const validCategories = ["bgm", "ambient"] + const validCategories = ["bgm", "ambient"]; // Check category - let category = null + let category = null; for (i of validCategories) if (i == inputCategory) - category = i + category = i; if (category === null) { console.debug("Bad request: unsuported asset category.");