spotify: fix credentials cache

Cache Spotify response instead of username and password.
This should resolve frequent "New login to Spotify" emails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1190>
This commit is contained in:
John King 2023-04-15 20:24:44 +00:00 committed by Sebastian Dröge
parent 57fe64b748
commit a434607515

View file

@ -488,9 +488,7 @@ impl SpotifyAudioSrc {
bail!("password is not set and credentials are not in cache"); bail!("password is not set and credentials are not in cache");
} }
let cred = Credentials::with_password(&settings.username, &settings.password); Credentials::with_password(&settings.username, &settings.password)
cache.save_credentials(&cred);
cred
} }
}; };
@ -505,7 +503,7 @@ impl SpotifyAudioSrc {
}; };
let (session, _credentials) = let (session, _credentials) =
Session::connect(SessionConfig::default(), credentials, Some(cache), false).await?; Session::connect(SessionConfig::default(), credentials, Some(cache), true).await?;
let player_config = PlayerConfig { let player_config = PlayerConfig {
passthrough: true, passthrough: true,