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
9
db.js
9
db.js
|
|
@ -19,6 +19,7 @@ db.exec(`
|
|||
sender_token TEXT UNIQUE NOT NULL,
|
||||
tts_voice TEXT NOT NULL DEFAULT 'ru-RU-DmitryNeural',
|
||||
display_duration_seconds INTEGER NOT NULL DEFAULT 10,
|
||||
ai_name TEXT NOT NULL DEFAULT 'Альтушка Ирина',
|
||||
created_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
|
|
@ -36,6 +37,9 @@ const existingColumns = db.prepare('PRAGMA table_info(streamers)').all().map((c)
|
|||
if (!existingColumns.includes('display_duration_seconds')) {
|
||||
db.exec('ALTER TABLE streamers ADD COLUMN display_duration_seconds INTEGER NOT NULL DEFAULT 10');
|
||||
}
|
||||
if (!existingColumns.includes('ai_name')) {
|
||||
db.exec("ALTER TABLE streamers ADD COLUMN ai_name TEXT NOT NULL DEFAULT 'Альтушка Ирина'");
|
||||
}
|
||||
|
||||
function generateToken() {
|
||||
return crypto.randomBytes(16).toString('hex');
|
||||
|
|
@ -86,6 +90,10 @@ function updateDisplayDuration(streamerId, seconds) {
|
|||
db.prepare('UPDATE streamers SET display_duration_seconds = ? WHERE id = ?').run(seconds, streamerId);
|
||||
}
|
||||
|
||||
function updateAiName(streamerId, aiName) {
|
||||
db.prepare('UPDATE streamers SET ai_name = ? WHERE id = ?').run(aiName, streamerId);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
findStreamerByOverlayToken,
|
||||
findStreamerBySenderToken,
|
||||
|
|
@ -93,4 +101,5 @@ module.exports = {
|
|||
getViewerName,
|
||||
setViewerName,
|
||||
updateDisplayDuration,
|
||||
updateAiName,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue