aboutsummaryrefslogtreecommitdiffstats
path: root/src/scrobbler.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-30 18:37:52 +0200
committersalmonik <salmonik@tuta.io>2026-07-30 18:37:52 +0200
commitda0251d55d3902c90967b36b7a5441404bdf24ef (patch)
tree6f8a74b7cddc16c35b3f9e536b9bbb86b259b545 /src/scrobbler.rs
parentMerge pull request 'mpris merge' (#2) from mpris into main (diff)
downloadrsplayer-da0251d55d3902c90967b36b7a5441404bdf24ef.tar.gz
rsplayer-da0251d55d3902c90967b36b7a5441404bdf24ef.zip
Fix synchronous HTTP calls
Diffstat (limited to '')
-rw-r--r--src/scrobbler.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scrobbler.rs b/src/scrobbler.rs
index 40d3ce6..e6e8a73 100644
--- a/src/scrobbler.rs
+++ b/src/scrobbler.rs
@@ -8,6 +8,7 @@
8use md5::{Digest, Md5}; 8use md5::{Digest, Md5};
9use reqwest::blocking::Client; 9use reqwest::blocking::Client;
10use std::collections::BTreeMap; 10use std::collections::BTreeMap;
11use std::time::Duration;
11 12
12pub struct Scrobbler { 13pub struct Scrobbler {
13 pub lastfm_api_key: Option<String>, 14 pub lastfm_api_key: Option<String>,
@@ -33,7 +34,11 @@ impl Scrobbler {
33 lastfm_api_secret, 34 lastfm_api_secret,
34 lastfm_session_key, 35 lastfm_session_key,
35 listenbrainz_token, 36 listenbrainz_token,
36 client: Client::new(), 37 client: Client::builder()
38 .connect_timeout(Duration::from_secs(10))
39 .timeout(Duration::from_secs(30))
40 .build()
41 .expect("valid reqwest Client"),
37 } 42 }
38 } 43 }
39 44