fix: accept user-specific playlist ids (LL, WL)
This commit is contained in:
parent
cf498e4a8f
commit
97c3f30d18
3 changed files with 5 additions and 2 deletions
|
|
@ -260,7 +260,7 @@ impl RustyPipeQuery {
|
|||
})
|
||||
} else if util::CHANNEL_ID_REGEX.is_match(s) {
|
||||
Ok(UrlTarget::Channel { id: s.to_owned() })
|
||||
} else if util::PLAYLIST_ID_REGEX.is_match(s) {
|
||||
} else if util::PLAYLIST_ID_REGEX.is_match(s) || util::USER_PLAYLIST_IDS.contains(&s) {
|
||||
if resolve_albums && s.starts_with(util::PLAYLIST_ID_ALBUM_PREFIX) {
|
||||
self._navigation_resolve_url(
|
||||
&format!("/playlist?list={s}"),
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ pub const PLAYLIST_ID_ALBUM_PREFIX: &str = "OLAK";
|
|||
pub const ARTIST_DISCOGRAPHY_PREFIX: &str = "MPAD";
|
||||
pub const PODCAST_PLAYLIST_PREFIX: &str = "MPSP";
|
||||
pub const PODCAST_EPISODE_PREFIX: &str = "MPED";
|
||||
/// Builtin user-specific playlists (Watch later, Liked videos, Liked tracks, Episodes for later)
|
||||
pub static USER_PLAYLIST_IDS: [&str; 4] = ["WL", "LL", "LM", "SE"];
|
||||
|
||||
const CONTENT_PLAYBACK_NONCE_ALPHABET: &[u8; 64] =
|
||||
b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue