mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-12-02 19:02:50 +08:00
fix(playback): skip blocked providers while advancing mixed queues
This commit is contained in:
1 parent
0adf21c566
commit
afb1cd7c14
5 files changed
+77
-11
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { Router, type Request } from "express";
|
||||
import type { BotInstance } from "../../bot/instance.js";
|
||||
import { blocksProviderForAdvance } from "../../bot/url-retry.js";
|
||||
import type { QueuedSong } from "../../audio/queue.js";
|
||||
import type { BotManager } from "../../bot/manager.js";
|
||||
import type { BotDatabase } from "../../data/database.js";
|
||||
@@ -127,7 +128,7 @@ export function createPlayerRouter(
|
||||
let failure: PlayFailure | undefined;
|
||||
const capture = (reason: PlayFailure) => { failure = reason; };
|
||||
let started = first ? await bot.resolveAndPlay(first, capture) : false;
|
||||
if (first && !started && failure?.code !== "risk_control" && queue.current() === first) {
|
||||
if (first && !started && !blocksProviderForAdvance(failure?.code) && queue.current() === first) {
|
||||
// Many collections contain several consecutive unavailable tracks.
|
||||
started = await bot.playNext(20, capture);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user