Credentials helper if config not present or unparseable

Fixes #1
This commit is contained in:
Michael Edwards
2019-03-27 22:35:31 +01:00
committed by Henrik Friedrichsen
parent 58f34b9288
commit d78e71871a
5 changed files with 248 additions and 26 deletions

View File

@@ -184,13 +184,13 @@ impl futures::Future for Worker {
}
impl Spotify {
pub fn new(events: EventManager, user: String, password: String) -> Spotify {
pub fn new(events: EventManager, credentials: Credentials) -> Spotify {
let player_config = PlayerConfig {
bitrate: Bitrate::Bitrate320,
normalisation: false,
normalisation_pregain: 0.0,
};
let credentials = Credentials::with_password(user.clone(), password.clone());
let user = credentials.username.clone();
let (tx, rx) = mpsc::unbounded();
{