mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
Fix ffmpeg spawn failure causing infinite retry loop
Two issues fixed: 1. Cross-platform ffmpeg-static resolution: skip Windows .exe paths on Linux and always fall back to "ffmpeg" instead of a known-bad path 2. Prevent trackEnd cascade when ffmpeg spawn fails — track consecutive failures and stop after 3, suppressing trackEnd on spawn errors https://claude.ai/code/session_013vHRF8BbDGjZLqheFS85Q6
This commit is contained in:
3 files changed
+47
-5
No files matched your search
@@ -154,6 +154,7 @@ export function createPlayerRouter(
|
||||
}
|
||||
const queue = bot.getQueueManager();
|
||||
bot.getPlayer().stop(); // Stop current playback first
|
||||
bot.getPlayer().resetFailures(); // Reset on user-initiated play
|
||||
const song = queue.playAt(index);
|
||||
if (!song) {
|
||||
res.status(400).json({ error: "Invalid queue index" });
|
||||
@@ -200,6 +201,7 @@ export function createPlayerRouter(
|
||||
|
||||
// Stop current playback
|
||||
bot.getPlayer().stop();
|
||||
bot.getPlayer().resetFailures();
|
||||
|
||||
const songs = await provider.getPlaylistSongs(playlistId);
|
||||
if (songs.length === 0) {
|
||||
@@ -256,6 +258,7 @@ export function createPlayerRouter(
|
||||
queue.add({ ...song, platform: provider.platform });
|
||||
queue.play();
|
||||
|
||||
bot.getPlayer().resetFailures();
|
||||
const ok = await bot.resolveAndPlay(queue.current()!);
|
||||
if (!ok) {
|
||||
res.json({ message: `Cannot play: ${song.name}` });
|
||||
|
||||
Reference in new issue
Block a user