Skip to content

Commit

Permalink
fix(spotify): use only track title as query
Browse files Browse the repository at this point in the history
  • Loading branch information
ayamdobhal committed Dec 24, 2024
1 parent cd002a0 commit cc45647
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/commands/music.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ pub async fn music(ctx: Context<'_>, song_name: Vec<String>) -> 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;
Expand Down

0 comments on commit cc45647

Please sign in to comment.