mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fix(music): resolve autoplay candidate exhaustion and voice connection stalls
- Expand autoplay candidate search pool to 20 tracks and increase mix pool TTL to 2 hours - Support multi-stage recommendations using both seed and last-played track - Add resilient fallback in pickAutoplayTrack to prevent playback from halting - Prevent race condition by clearing _playingNext before queueEnd playNext() - Auto-reconnect voice connection before track advancement if connection dropped
This commit is contained in:
1 parent
7df4e0cd36
commit
ed76a6ebfe
3 files changed
+106
-55
No files matched your search
@@ -486,7 +486,8 @@ class Player extends EventEmitter {
|
||||
logger.player(`[Player] Busy joining. Ignoring: ${channelId}`);
|
||||
return;
|
||||
}
|
||||
if (this._voiceConn && this._channelId === channelId) {
|
||||
const isConnActive = this._voiceConn && (typeof this._voiceConn.isConnected !== "function" || this._voiceConn.isConnected());
|
||||
if (isConnActive && this._channelId === channelId) {
|
||||
logger.player(`[Player] Already in channel: ${channelId}`);
|
||||
return;
|
||||
}
|
||||
@@ -603,6 +604,13 @@ class Player extends EventEmitter {
|
||||
voiceConn.on("disconnect", () => {
|
||||
if (this.leaving || this._destroyed) return;
|
||||
logger.player(`[Player] Voice connection disconnected`);
|
||||
this._voiceConn = null;
|
||||
this.connection = null;
|
||||
const cId = cleanId(this._channelId ?? this._home247Channel ?? "");
|
||||
if (cId && (this._get247Mode() === "on" || this.queue?.getCurrent() || !(this.queue?.isEmpty?.() ?? true))) {
|
||||
logger.player(`[Player] Voice disconnected with active session — scheduling reconnect to channel ${cId}`);
|
||||
this.join(cId).catch(err => logger.warn(`[Player] Voice reconnect after disconnect failed: ${err?.message}`));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user