This commit is contained in:
NoLogicAlan committed 2026-09-04 03:28:20 +03:00
1 parent 9e67bcce25
commit 74fa8da4eb
1 file changed
+12 -10
+12 -10
View File
@@ -166,16 +166,6 @@ async function pickAutoplayTrack(p, ctx, lastTrack) {
p._autoplayPreferredPoolVid = videoId; p._autoplayPreferredPoolVid = videoId;
return cached; return cached;
} }
try {
const mixUrl = `https://www.youtube.com/watch?v=${videoId}&list=RD${videoId}`;
const candidates = await resolveCandidates(p, mixUrl, "yt");
if (candidates.length) {
storePool(p, videoId, candidates);
p._autoplayPreferredPoolVid = videoId;
return candidates[Math.floor(Math.random() * Math.min(PICK_POOL, candidates.length))];
}
} catch (e) { logger.warn("[Autoplay] Mix strategy failed:", e?.message); }
} }
const lf = ctx?.lastfm; const lf = ctx?.lastfm;
@@ -212,6 +202,18 @@ async function pickAutoplayTrack(p, ctx, lastTrack) {
} catch (_) {} } catch (_) {}
} }
if (videoId) {
try {
const mixUrl = `https://www.youtube.com/watch?v=${videoId}&list=RD${videoId}`;
const candidates = await resolveCandidates(p, mixUrl, "yt");
if (candidates.length) {
storePool(p, videoId, candidates);
p._autoplayPreferredPoolVid = videoId;
return candidates[Math.floor(Math.random() * Math.min(PICK_POOL, candidates.length))];
}
} catch (e) { logger.warn("[Autoplay] Mix strategy failed:", e?.message); }
}
return null; return null;
} }