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:
Claude committed 2026-04-07 12:03:33 +00:00
1 parent 01940e74dd
commit d1fc7baa5d
3 files changed
+47 -5

No files matched your search

+3
View File
@@ -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}` });