fix: accept user-specific playlist ids (LL, WL)

This commit is contained in:
ThetaDev 2025-01-05 03:56:38 +01:00
parent cf498e4a8f
commit 97c3f30d18
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
3 changed files with 5 additions and 2 deletions

View file

@ -71,8 +71,9 @@ pub fn channel_id<S: AsRef<str>>(channel_id: S) -> Result<(), Error> {
/// assert!(validate::playlist_id("Abcd").is_err());
/// ```
pub fn playlist_id<S: AsRef<str>>(playlist_id: S) -> Result<(), Error> {
let id = playlist_id.as_ref();
check(
util::PLAYLIST_ID_REGEX.is_match(playlist_id.as_ref()),
util::PLAYLIST_ID_REGEX.is_match(id) || util::USER_PLAYLIST_IDS.contains(&id),
"invalid playlist id",
)
}