Skip to content

Commit 3db3c32

Browse files
authored
Merge pull request #8 from DylanCa/develop
2 parents e9026ab + c164b6f commit 3db3c32

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "apple-music"
33
authors = ["Dylan Cattelan <[email protected]"]
4-
version = "0.11.1"
4+
version = "0.11.2"
55
edition = "2021"
66
description = "A Rust Library to fully control local MacOS Apple Music player."
77
documentation = "https://docs.rs/apple-music/latest"
@@ -20,3 +20,4 @@ env_logger = "0.10.1"
2020
strum = { version = "0.25.0", features = ["derive"] }
2121
strum_macros = "0.25.3"
2222
reqwest = { version = "0.11.23", features = ["blocking"] }
23+
urlencoding = "2.1.3"

Diff for: src/track.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::error::Error;
22
use crate::script_controller::{ParamType, ScriptController};
33
use serde::Deserialize;
44
use std::io::Read;
5+
use urlencoding::encode;
56

67
/// Provides data related to a specific Track as well as its artworks.
78
#[derive(Deserialize, Debug)]
@@ -328,14 +329,14 @@ impl Track {
328329
fn fetch_itunes_store_data(&mut self) {
329330
let request = format!(
330331
"https://itunes.apple.com/search?term={}&entity=song&attribute=albumTerm&limit=200",
331-
self.album
332+
encode(self.album.as_str())
332333
);
333334
self.fetch_itunes_store_by_request(request);
334335

335336
if self.artwork_url == None {
336337
let request = format!(
337338
"https://itunes.apple.com/search?term={}&entity=song&limit=200",
338-
self.name
339+
encode(self.album.as_str())
339340
);
340341
self.fetch_itunes_store_by_request(request);
341342
}

0 commit comments

Comments
 (0)