Migrate ncspot to librespot 0.5 breaking changes
- Set `client_id` via `SessionConfig` - Use `TokenProvider` to obtain client token instead of custom Mercury call - Other minor changes
This commit is contained in:
@@ -105,13 +105,13 @@ impl WebApi {
|
||||
if let Ok(Some(token)) = token_rx.recv() {
|
||||
*api_token.lock().unwrap() = Some(Token {
|
||||
access_token: token.access_token,
|
||||
expires_in: chrono::Duration::try_seconds(token.expires_in.into()).unwrap(),
|
||||
scopes: HashSet::from_iter(token.scope),
|
||||
expires_in: chrono::Duration::from_std(token.expires_in).unwrap(),
|
||||
scopes: HashSet::from_iter(token.scopes),
|
||||
expires_at: None,
|
||||
refresh_token: None,
|
||||
});
|
||||
*api_token_expiration.write().unwrap() =
|
||||
Utc::now() + ChronoDuration::try_seconds(token.expires_in.into()).unwrap();
|
||||
Utc::now() + ChronoDuration::from_std(token.expires_in).unwrap();
|
||||
} else {
|
||||
error!("Failed to update token");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user