diff options
Diffstat (limited to '')
| -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 | ||
