aboutsummaryrefslogtreecommitdiff
path: root/import/src/acoustid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/src/acoustid.rs')
-rw-r--r--import/src/acoustid.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/import/src/acoustid.rs b/import/src/acoustid.rs
index 49c5e38..5692674 100644
--- a/import/src/acoustid.rs
+++ b/import/src/acoustid.rs
@@ -3,6 +3,7 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
+use crate::USER_AGENT;
use anyhow::Result;
use bincode::{Decode, Encode};
use jellybase::cache::async_cache_memory;
@@ -56,10 +57,16 @@ pub(crate) struct AcoustIDLookupResponse {
impl AcoustID {
pub fn new(api_key: &str) -> Self {
let client = ClientBuilder::new()
- .default_headers(HeaderMap::from_iter([(
- HeaderName::from_static("accept"),
- HeaderValue::from_static("application/json"),
- )]))
+ .default_headers(HeaderMap::from_iter([
+ (
+ HeaderName::from_static("accept"),
+ HeaderValue::from_static("application/json"),
+ ),
+ (
+ HeaderName::from_static("user-agent"),
+ HeaderValue::from_static(USER_AGENT),
+ ),
+ ]))
.build()
.unwrap();
Self {