From cc45647056665227a6908f5fa11b772c3fe818dd Mon Sep 17 00:00:00 2001 From: ayamdobhal Date: Wed, 25 Dec 2024 03:09:53 +0530 Subject: [PATCH] fix(spotify): use only track title as query --- src/commands/music.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/commands/music.rs b/src/commands/music.rs index 7761a5c..9ec7610 100644 --- a/src/commands/music.rs +++ b/src/commands/music.rs @@ -102,9 +102,7 @@ pub async fn music(ctx: Context<'_>, song_name: Vec) -> Result<(), Error let spotify_client_secret = std::env::var("SPOTIFY_CLIENT_SECRET").expect("missing SPOTIFY_CLIENT_SECRET"); let mut spotify = SpotifyClient::new(spotify_client_id, spotify_client_secret); - let songs = spotify - .get_track(format!("{} - {}", track.name, track.artist)) - .await; + let songs = spotify.get_track(track.name.to_string()).await; if songs.is_ok() { let tracks = songs.unwrap().tracks.unwrap().items; track.can_scrobble = true;