fix(playback): skip blocked providers while advancing mixed queues

This commit is contained in:
TIANYAO ZHANG committed 2026-11-18 18:22:50 +08:00
1 parent 0adf21c566
commit afb1cd7c14
5 files changed
+77 -11

No files matched your search

+2 -1
View File
@@ -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);
}