mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-05 10:49:40 +02:00
Add product metrics to requests
This commit is contained in:
parent
286a031d94
commit
2af34fc674
4 changed files with 31 additions and 2 deletions
|
@ -136,6 +136,14 @@ impl SpClient {
|
|||
let mut url = self.base_url().await;
|
||||
url.push_str(endpoint);
|
||||
|
||||
// Add metrics. There is also an optional `partner` key with a value like
|
||||
// `vodafone-uk` but we've yet to discover how we can find that value.
|
||||
let separator = match url.find('?') {
|
||||
Some(_) => "&",
|
||||
None => "?",
|
||||
};
|
||||
url.push_str(&format!("{}product=0", separator));
|
||||
|
||||
let mut request = Request::builder()
|
||||
.method(method)
|
||||
.uri(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue