Add only the track when a link carries both a video and a list

A link copied from an open mix (watch?v=…&list=RD…) expanded into the
whole radio station — 500 entries from one paste. Any URL with a `v=`
parameter now resolves to that single track, and only a /playlist?list=…
URL expands. The rule is deliberately blunt rather than keyed on
start_radio, so pasting a link behaves the same way every time.

Playlist expansion is also capped separately from the queue limit
(MAX_PLAYLIST_TRACKS, 100 by default) and the chat says when a playlist
hit that ceiling.

Verified against the real yt-dlp: both mix links resolve to one track, a
plain video link to one, and a playlist URL to its 13 entries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-09-09 00:20:35 +03:00
co-authored by Claude Opus 5
parent ffcf88efb7
commit 6d65134f8e
6 changed files with 34 additions and 6 deletions
+2
View File
@@ -49,6 +49,8 @@ const schema = z.object({
DEFAULT_VOLUME: z.coerce.number().min(0).max(200).default(60),
MAX_QUEUE_SIZE: z.coerce.number().int().positive().default(500),
/** Upper bound on how many tracks one pasted playlist may add. */
MAX_PLAYLIST_TRACKS: z.coerce.number().int().positive().default(100),
SEARCH_RESULT_LIMIT: z.coerce.number().int().positive().max(25).default(10),
/** Seconds to wait after the last human leaves the voice channel (0 — never leave). */
EMPTY_TIMEOUT_SECONDS: z.coerce.number().int().min(0).default(120),