diff --git a/src/main.rs b/src/main.rs index 4aeaa8e4e..7561a92cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2064,7 +2064,7 @@ async fn main() { setup.start_position, last_credentials, setup.player_config, - setup.session_config, + session, ) .await; exit(0); @@ -2074,7 +2074,7 @@ async fn main() { setup.scopes, setup.save_token, last_credentials, - setup.session_config, + session, ) .await; exit(0); diff --git a/src/spotty.rs b/src/spotty.rs index df58f7ee5..c38c71879 100644 --- a/src/spotty.rs +++ b/src/spotty.rs @@ -6,7 +6,6 @@ use std::fs; use std::process::exit; use librespot::core::authentication::Credentials; -use librespot::core::config::SessionConfig; use librespot::core::session::Session; use librespot::core::spotify_id::SpotifyId; @@ -49,13 +48,12 @@ pub async fn get_token( scopes: Option, save_token: Option, last_credentials: Option, - session_config: SessionConfig, + session: Session, ) { match last_credentials { Some(last_credentials) => { if let Some(client_id) = client_id { let scopes = scopes.unwrap_or_else(|| SCOPES.to_string()); - let session = Session::new(session_config, None); session.set_client_id(client_id.as_str()); match session.connect(last_credentials, true).await { @@ -113,7 +111,7 @@ pub async fn play_track( start_position: u32, last_credentials: Option, player_config: PlayerConfig, - session_config: SessionConfig, + session: Session, ) { match last_credentials { Some(last_credentials) => { @@ -127,7 +125,6 @@ pub async fn play_track( .as_str(), ); - let session = Session::new(session_config, None); if let Err(error) = session.connect(last_credentials, false).await { error!("Failed to create session (play_track): {:?}", error); return;