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:
parent
0b7ccc803c
commit
32df4a401d
6 changed files with 34 additions and 24 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue