Let streamers name their AI assistant; fix overlay TTS audio overlap
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 30s
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 30s
Streamer dashboard gains an editable AI assistant name (default "Альтушка Ирина"), stored per-streamer and used for the overlay label, TTS intro, and DeepSeek system prompt. Also fixes a bug where a long message's TTS audio could still be playing when the next queued message started its own audio — the overlay queue now waits for the current audio to actually finish (not just the configured display duration) before advancing.
This commit is contained in:
parent
fec77e2737
commit
ec6d8c4cfe
6 changed files with 106 additions and 22 deletions
|
|
@ -61,6 +61,9 @@
|
|||
border: 1px solid #ccc;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.settings-row input#ai-name {
|
||||
width: 220px;
|
||||
}
|
||||
.settings-row button {
|
||||
padding: 8px 16px;
|
||||
cursor: pointer;
|
||||
|
|
@ -101,11 +104,22 @@
|
|||
<div class="settings-row">
|
||||
<input id="display-duration" type="number" min="1" max="120" />
|
||||
<span>сек.</span>
|
||||
<button id="save-duration">Сохранить</button>
|
||||
</div>
|
||||
<div id="settings-status"></div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Имя ИИ-помощника</h2>
|
||||
<p>Как зовут вашего ИИ-помощника, который отвечает зрителям (по умолчанию «Альтушка Ирина»).</p>
|
||||
<div class="settings-row">
|
||||
<input id="ai-name" type="text" maxlength="60" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-row">
|
||||
<button id="save-settings">Сохранить</button>
|
||||
</div>
|
||||
<div id="settings-status"></div>
|
||||
|
||||
<p id="logout">выйти</p>
|
||||
|
||||
<script>
|
||||
|
|
@ -126,15 +140,17 @@
|
|||
document.getElementById('overlay-url').value = data.overlayUrl;
|
||||
document.getElementById('sender-url').value = data.senderUrl;
|
||||
document.getElementById('display-duration').value = data.displayDurationSeconds;
|
||||
document.getElementById('ai-name').value = data.aiName;
|
||||
}
|
||||
|
||||
document.getElementById('save-duration').addEventListener('click', async () => {
|
||||
document.getElementById('save-settings').addEventListener('click', async () => {
|
||||
const statusEl = document.getElementById('settings-status');
|
||||
const seconds = Number(document.getElementById('display-duration').value);
|
||||
const aiName = document.getElementById('ai-name').value;
|
||||
const res = await fetch('/api/settings', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ displayDurationSeconds: seconds }),
|
||||
body: JSON.stringify({ displayDurationSeconds: seconds, aiName }),
|
||||
});
|
||||
if (res.ok) {
|
||||
statusEl.textContent = 'Сохранено';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue