mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-06 03:50:06 +02:00
Merge branch 'dev' into new-api and update crates
This commit is contained in:
commit
05b9b13cf8
41 changed files with 975 additions and 804 deletions
|
@ -126,7 +126,11 @@ impl Session {
|
|||
}))
|
||||
}
|
||||
|
||||
pub async fn connect(&self, credentials: Credentials) -> Result<(), Error> {
|
||||
pub async fn connect(
|
||||
&self,
|
||||
credentials: Credentials,
|
||||
store_credentials: bool,
|
||||
) -> Result<(), Error> {
|
||||
let ap = self.apresolver().resolve("accesspoint").await?;
|
||||
info!("Connecting to AP \"{}:{}\"", ap.0, ap.1);
|
||||
let mut transport = connection::connect(&ap.0, ap.1, self.config().proxy.as_ref()).await?;
|
||||
|
@ -136,7 +140,9 @@ impl Session {
|
|||
info!("Authenticated as \"{}\" !", reusable_credentials.username);
|
||||
self.set_username(&reusable_credentials.username);
|
||||
if let Some(cache) = self.cache() {
|
||||
cache.save_credentials(&reusable_credentials);
|
||||
if store_credentials {
|
||||
cache.save_credentials(&reusable_credentials);
|
||||
}
|
||||
}
|
||||
|
||||
let (tx_connection, rx_connection) = mpsc::unbounded_channel();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue