1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-05 10:49:40 +02:00

Add configurable client ID and listen for updates

This commit is contained in:
Roderick van Domburg 2022-01-12 22:09:57 +01:00
parent 0b7ccc803c
commit 32df4a401d
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
6 changed files with 34 additions and 24 deletions

View file

@ -333,7 +333,12 @@ impl SpClient {
.get_user_attribute(attribute)
.ok_or_else(|| SpClientError::Attribute(attribute.to_string()))?;
let url = template.replace("{id}", &preview_id.to_base16());
let mut url = template.replace("{id}", &preview_id.to_base16());
let separator = match url.find('?') {
Some(_) => "&",
None => "?",
};
url.push_str(&format!("{}cid={}", separator, self.session().client_id()));
self.request_url(url).await
}