|
@@ -11,16 +11,15 @@ pub async fn process_query(query: &str) -> Result<Vec<(Song, Option<Work>)>, Str
|
|
if query.contains("spotify") && query.contains("/playlist/"){
|
|
if query.contains("spotify") && query.contains("/playlist/"){
|
|
let split: Vec<&str> = query
|
|
let split: Vec<&str> = query
|
|
.split("/playlist/")
|
|
.split("/playlist/")
|
|
- .filter(|s| s.len() > 0)
|
|
|
|
|
|
+ .filter(|s| !s.is_empty())
|
|
.collect();
|
|
.collect();
|
|
if split.len() != 2 {
|
|
if split.len() != 2 {
|
|
return Err("invalid spotify playlist URL".to_string());
|
|
return Err("invalid spotify playlist URL".to_string());
|
|
}
|
|
}
|
|
let playlist_id = split[1];
|
|
let playlist_id = split[1];
|
|
let playlist_id = playlist_id
|
|
let playlist_id = playlist_id
|
|
- .split("?")
|
|
|
|
- .filter(|s| s.len() > 0)
|
|
|
|
- .next()
|
|
|
|
|
|
+ .split('?')
|
|
|
|
+ .find(|s| !s.is_empty())
|
|
.expect("Logical error: process_query's playlist_id contains items?");
|
|
.expect("Logical error: process_query's playlist_id contains items?");
|
|
let songs = match get_playlist(playlist_id).await{
|
|
let songs = match get_playlist(playlist_id).await{
|
|
Ok(songs) => songs,
|
|
Ok(songs) => songs,
|