Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aome510 committed Apr 20, 2024
1 parent 9482f58 commit 7b34443
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
8 changes: 3 additions & 5 deletions spotify_player/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ impl Client {
)
.await?;
// let first_page = self
//
// .current_user_playlists_manual(Some(50), None)
// .await?;

Expand Down Expand Up @@ -770,7 +769,7 @@ impl Client {
Ok(())
}

/// Get recommended (radio) tracks based on a seed
/// Get recommendation (radio) tracks based on a seed
pub async fn radio_tracks(&self, seed_uri: String) -> Result<Vec<Track>> {
let session = self.session().await;

Expand Down Expand Up @@ -874,7 +873,7 @@ impl Client {
})
}

/// Search for items of a specific type
/// Search for items of a specific type matching a given query
pub async fn search_specific_type(
&self,
query: &str,
Expand Down Expand Up @@ -1107,7 +1106,6 @@ impl Client {
// TODO: this should use `rspotify::playlist` API instead of `internal_call`
// See: https://github.com/ramsayleung/rspotify/issues/459
// let playlist = self
//
// .playlist(playlist_id, None, Some(Market::FromToken))
// .await?;
let playlist = self
Expand Down Expand Up @@ -1200,7 +1198,7 @@ impl Client {
})
}

/// Call a GET HTTP request to the Spotify server
/// Make a GET HTTP request to the Spotify server
async fn http_get<T>(&self, url: &str, payload: &Query<'_>) -> Result<T>
where
T: serde::de::DeserializeOwned,
Expand Down
5 changes: 2 additions & 3 deletions spotify_player/src/client/spotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ pub struct Spotify {
token: Arc<Mutex<Option<Token>>>,
client_id: String,
http: HttpClient,
// session should be always non-empty, but `Option` is required
// for the struct to implement `Default`, which is required to
// implement `rspotify::BaseClient`
// session should always be non-empty, but `Option` is used to implement `Default`,
// which is required to implement `rspotify::BaseClient` trait
pub(crate) session: Arc<tokio::sync::Mutex<Option<Session>>>,
}

Expand Down
4 changes: 2 additions & 2 deletions spotify_player/src/streaming.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{config, state::SharedState};
use crate::{client::Client, config, state::SharedState};
use librespot_connect::spirc::Spirc;
use librespot_core::{
config::{ConnectConfig, DeviceType},
Expand Down Expand Up @@ -160,7 +160,7 @@ fn execute_player_event_hook_command(
}

/// Create a new streaming connection
pub async fn new_connection(client: crate::client::Client, state: SharedState) -> Spirc {
pub async fn new_connection(client: Client, state: SharedState) -> Spirc {
let session = client.session().await;
let device = &state.configs.app_config.device;

Expand Down

0 comments on commit 7b34443

Please sign in to comment.