diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-30 18:37:52 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-30 18:37:52 +0200 |
| commit | da0251d55d3902c90967b36b7a5441404bdf24ef (patch) | |
| tree | 6f8a74b7cddc16c35b3f9e536b9bbb86b259b545 /src/scrobbler.rs | |
| parent | Merge pull request 'mpris merge' (#2) from mpris into main (diff) | |
| download | rsplayer-da0251d55d3902c90967b36b7a5441404bdf24ef.tar.gz rsplayer-da0251d55d3902c90967b36b7a5441404bdf24ef.zip | |
Fix synchronous HTTP calls
Diffstat (limited to 'src/scrobbler.rs')
| -rw-r--r-- | src/scrobbler.rs | 7 |
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 @@ | |||
| 8 | use md5::{Digest, Md5}; | 8 | use md5::{Digest, Md5}; |
| 9 | use reqwest::blocking::Client; | 9 | use reqwest::blocking::Client; |
| 10 | use std::collections::BTreeMap; | 10 | use std::collections::BTreeMap; |
| 11 | use std::time::Duration; | ||
| 11 | 12 | ||
| 12 | pub struct Scrobbler { | 13 | pub 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 | ||
