From cc7a03b774268bdb505f94bfd564ac9a50eb49cb Mon Sep 17 00:00:00 2001 From: 0xNF <0xNF@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:04:06 +0900 Subject: [PATCH] fix: Don't crash when attempting to download local tracks by skipping them (#88) Co-authored-by: 0xnf <0xnf@winetech.com> --- src/downloader.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/downloader.rs b/src/downloader.rs index cf4f7f5..2760c4e 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -84,7 +84,11 @@ impl Downloader { let uri = Spotify::parse_uri(uri)?; let item = self.spotify.resolve_uri(&uri).await?; match item { - SpotifyItem::Track(t) => self.add_to_queue(t.into()).await, + SpotifyItem::Track(t) => { + if !t.is_local { + self.add_to_queue(t.into()).await; + } + } SpotifyItem::Album(a) => { let tracks = self.spotify.full_album(&a.id).await?; let queue: Vec = tracks.into_iter().map(|t| t.into()).collect();