1
0
Fork 0
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:
Roderick van Domburg 2021-12-30 22:36:38 +01:00
parent 286a031d94
commit 2af34fc674
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
4 changed files with 31 additions and 2 deletions

View file

@ -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)