diff --git a/src/bot/instance.ts b/src/bot/instance.ts index 6768432..097974d 100644 --- a/src/bot/instance.ts +++ b/src/bot/instance.ts @@ -491,7 +491,7 @@ export class BotInstance extends EventEmitter { for (let i = 0; i < 3; i++) { const retry = this.queue.next(); if (!retry) break; - if (await this.resolveAndPlay(retry)) return; + if (await this.resolveAndPlay(retry)) break; } this.player.stop(); } diff --git a/src/ts-protocol/client.ts b/src/ts-protocol/client.ts index e922f13..761dd27 100644 --- a/src/ts-protocol/client.ts +++ b/src/ts-protocol/client.ts @@ -154,8 +154,7 @@ export class TS3Client extends EventEmitter { } sendVoiceData(opusFrame: Buffer): void { - if (!this.client) return; - // Codec 5 = CODEC_OPUS_MUSIC + if (!this.client || this.disconnecting) return; this.client.sendVoice(opusFrame, 5); } diff --git a/src/web/api/player.ts b/src/web/api/player.ts index 1e5c3a2..5daaba7 100644 --- a/src/web/api/player.ts +++ b/src/web/api/player.ts @@ -152,6 +152,7 @@ export function createPlayerRouter( return; } const queue = bot.getQueueManager(); + bot.getPlayer().stop(); // Stop current playback first const song = queue.playAt(index); if (!song) { res.status(400).json({ error: "Invalid queue index" }); diff --git a/web/src/components/Player.vue b/web/src/components/Player.vue index a8b91bf..8126932 100644 --- a/web/src/components/Player.vue +++ b/web/src/components/Player.vue @@ -24,13 +24,13 @@ - +
{{ currentSong.name }}
{{ currentSong.artist }}
- +
{{ formatTime(currentElapsed) }} @@ -63,9 +63,9 @@ - +
@@ -74,16 +74,27 @@