mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-09 10:45:27 +00:00
spotify: check cached creds username before use
If a username was specified, only use cached credentials that match that username. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1204>
This commit is contained in:
parent
fc5ff9503d
commit
adfceaea77
1 changed files with 5 additions and 2 deletions
|
@ -474,11 +474,14 @@ impl SpotifyAudioSrc {
|
||||||
let cache = Cache::new(credentials_cache, None, files_cache, max_size)?;
|
let cache = Cache::new(credentials_cache, None, files_cache, max_size)?;
|
||||||
|
|
||||||
let credentials = match cache.credentials() {
|
let credentials = match cache.credentials() {
|
||||||
Some(cached_cred) => {
|
Some(cached_cred)
|
||||||
|
if settings.username.is_empty()
|
||||||
|
|| settings.username == cached_cred.username =>
|
||||||
|
{
|
||||||
gst::debug!(CAT, imp: self, "reuse credentials from cache",);
|
gst::debug!(CAT, imp: self, "reuse credentials from cache",);
|
||||||
cached_cred
|
cached_cred
|
||||||
}
|
}
|
||||||
None => {
|
_ => {
|
||||||
gst::debug!(CAT, imp: self, "credentials not in cache",);
|
gst::debug!(CAT, imp: self, "credentials not in cache",);
|
||||||
|
|
||||||
if settings.username.is_empty() {
|
if settings.username.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue