chore: bump rspotify to latest version

0.3.x
Davide Polonio 2024-01-14 19:08:12 +01:00
parent 8b227c7bbb
commit 30990304d9
2 changed files with 7 additions and 4 deletions

View File

@ -10,7 +10,7 @@ teloxide = { version = "0.9.2", features = ["auto-send", "macros"] }
log = "0.4.17"
pretty_env_logger = "0.5.0"
tokio = { version = "1.20.0", features = ["rt-multi-thread", "macros"] }
rspotify = { version = "0.11.7", features = ["default"]}
rspotify = { version = "0.12.0", features = ["default"]}
sentry = "0.32.1"
invidious = "0.2.1"
itertools = "0.12.0"

View File

@ -1,8 +1,9 @@
use async_trait::async_trait;
#[cfg(test)]
use mockall::{automock, mock, predicate::*};
use rspotify::model::Country::UnitedStates;
use rspotify::model::PlayableItem::{Episode, Track};
use rspotify::model::{AlbumId, PlaylistId, TrackId};
use rspotify::model::{AlbumId, PlaylistId, TrackId, Market};
use rspotify::prelude::*;
use rspotify::{ClientCredsSpotify, Credentials};
use std::sync::Arc;
@ -99,7 +100,8 @@ impl SearchableClient for Client {
Err(_e) => return None,
};
match self.client.track(track_id).await {
// Search track from US market
match self.client.track(track_id, Some(Market::Country(UnitedStates))).await {
Ok(track) => Some(TrackInfo {
name: track.name,
artists: track.artists.iter().map(|x| x.name.clone()).collect(),
@ -115,7 +117,8 @@ impl SearchableClient for Client {
Err(_e) => return None,
};
match self.client.album(album_id).await {
// Search album from US market
match self.client.album(album_id, Some(Market::Country(UnitedStates))).await {
Ok(album) => Some(AlbumInfo {
name: album.name,
artists: album.artists.iter().map(|x| x.name.clone()).collect(),