1
0
Fork 0
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:
Roderick van Domburg 2022-07-27 23:31:11 +02:00
commit 05b9b13cf8
No known key found for this signature in database
GPG key ID: 87F5FDE8A56219F4
41 changed files with 975 additions and 804 deletions

View file

@ -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();