diff --git a/src/spotify.rs b/src/spotify.rs index d0bdc58..34dda3d 100644 --- a/src/spotify.rs +++ b/src/spotify.rs @@ -576,4 +576,20 @@ impl Spotify { let new = (progress.as_secs() * 1000) as i32 + progress.subsec_millis() as i32 + delta; self.seek(std::cmp::max(0, new) as u32); } + + pub fn is_album(s: &str) -> bool { + s.starts_with("spotify:album:") + } + + pub fn is_artist(s: &str) -> bool { + s.starts_with("spotify:artist:") + } + + pub fn is_track(s: &str) -> bool { + s.starts_with("spotify:track:") + } + + pub fn is_playlist(s: &str) -> bool { + s.starts_with("spotify:user:") && s.contains(":playlist:") + } }