Add Spotify URI resource helpers
This commit is contained in:
committed by
Henrik Friedrichsen
parent
f6d674d9be
commit
de1062471f
@@ -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:")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user