diff --git a/.dir-locals.el b/.dir-locals.el index 6bf7425e..c8fe8be5 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,4 +1,6 @@ ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") -((rustic-mode . ((lsp-rust-features . ["lyric-finder" "image" "notify" "clipboard"])))) +((rustic-mode . ((eglot-workspace-configuration + . (:rust-analyzer (:cargo (:features ["lyric-finder" "image" "notify" "clipboard"]) + :check (:command "clippy"))))))) diff --git a/spotify_player/src/client/mod.rs b/spotify_player/src/client/mod.rs index 4ff122c9..2765a0af 100644 --- a/spotify_player/src/client/mod.rs +++ b/spotify_player/src/client/mod.rs @@ -15,7 +15,7 @@ use librespot_connect::spirc::Spirc; use librespot_core::session::Session; use rspotify::{ http::Query, - model::{FullPlaylist, Market}, + model::{FullPlaylist, Market, Page, SimplifiedPlaylist}, prelude::*, }; @@ -47,9 +47,7 @@ struct TrackData { const SPOTIFY_API_ENDPOINT: &str = "https://api.spotify.com/v1"; fn market_query() -> Query<'static> { - let mut payload = Query::with_capacity(1); - payload.insert("market", "from_token"); - payload + Query::from([("market", "from_token")]) } impl Client { @@ -678,10 +676,18 @@ impl Client { /// gets all playlists of the current user pub async fn current_user_playlists(&self) -> Result> { + // TODO: this should use `rspotify::current_user_playlists_manual` API instead of `internal_call` + // See: https://github.com/ramsayleung/rspotify/issues/459 let first_page = self - .spotify - .current_user_playlists_manual(Some(50), None) + .internal_call::>( + &format!("{SPOTIFY_API_ENDPOINT}/me/playlists"), + &Query::from([("limit", "50")]), + ) .await?; + // let first_page = self + // .spotify + // .current_user_playlists_manual(Some(50), None) + // .await?; let playlists = self.all_paging_items(first_page, &Query::new()).await?; Ok(playlists.into_iter().map(|p| p.into()).collect())