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

+2
View File
@@ -263,6 +263,8 @@ export class BotInstance extends EventEmitter {
this.queue.add({ ...song, platform: provider.platform });
this.queue.play();
// Reset failure counter on user-initiated play
this.player.resetFailures();
const ok = await this.resolveAndPlay(this.queue.current()!);
if (!ok) return `Cannot play: ${song.name}`;
return `Now playing: ${song.name} - ${song.artist}`;