summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-06-04 11:17:38 +0200
committerYuval Adam <_@yuv.al>2024-06-04 11:17:38 +0200
commit7602f93105510766a5b21878819d6dbc66dd1e01 (patch)
treeb88c27fd594b1c5be9d3ccdd327343bb80d509b3
parenta4ae080d330b8917b22f2f2e017f508f49fecd5e (diff)
Use published icy-metadata crate
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/audio/rodio.rs6
3 files changed, 5 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e1197c5..7fd9568 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -625,6 +625,8 @@ dependencies = [
[[package]]
name = "icy-metadata"
version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "473e3fafde6c9b9d0753315701d000317db6965085bafcf7369c8d945dd5ef3b"
dependencies = [
"http",
"reqwest",
diff --git a/Cargo.toml b/Cargo.toml
index e93e03a..53301d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ keywords = ["radio", "somafm", "media"]
repository = "https://github.com/yuvadm/somafm.rs"
[dependencies]
-icy-metadata = { version = "0.1.0", path = "../icy-metadata" }
+icy-metadata = { version = "0.1.0" }
inquire = "0.7.5"
reqwest = { version = "0.12.4", features = ["blocking"] }
rodio = { version = "0.18.1", features = ["symphonia", "symphonia-mp3"] }
diff --git a/src/audio/rodio.rs b/src/audio/rodio.rs
index 2557ed4..0f9fbb2 100644
--- a/src/audio/rodio.rs
+++ b/src/audio/rodio.rs
@@ -49,10 +49,8 @@ impl Rodio {
// response. This will allow us to parse the metadata within the stream
icy_headers.metadata_interval(),
|metadata| {
- if metadata.is_ok() {
- let md = metadata.unwrap();
- if md.track_title().is_some() {
- let tr = md.track_title().unwrap();
+ if let Ok(md) = metadata {
+ if let Some(tr) = md.stream_title() {
println!(" {tr}");
}
}