fix: Don't crash when attempting to download local tracks in playlists by filtering them
This commit is contained in:
parent
e29731e473
commit
bb7defbe72
1 changed files with 5 additions and 1 deletions
|
|
@ -97,7 +97,11 @@ impl Downloader {
|
||||||
}
|
}
|
||||||
SpotifyItem::Playlist(p) => {
|
SpotifyItem::Playlist(p) => {
|
||||||
let tracks = self.spotify.full_playlist(&p.id).await?;
|
let tracks = self.spotify.full_playlist(&p.id).await?;
|
||||||
let queue: Vec<Download> = tracks.into_iter().map(|t| t.into()).collect();
|
let queue: Vec<Download> = tracks
|
||||||
|
.into_iter()
|
||||||
|
.filter(|t| !t.is_local)
|
||||||
|
.map(|t| t.into())
|
||||||
|
.collect();
|
||||||
self.add_to_queue_multiple(queue).await;
|
self.add_to_queue_multiple(queue).await;
|
||||||
}
|
}
|
||||||
SpotifyItem::Artist(a) => {
|
SpotifyItem::Artist(a) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue