🏡 index : ~doyle/sonos.rs.git

author Jordan Doyle <jordan@doyle.la> 2020-02-20 20:34:57.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2020-02-20 20:34:57.0 +00:00:00
commit
c10c81127ebb36cc2708c0e3e9c183c8001f7ab1 [patch]
tree
d9b1ca65453f40beeca4a4244ec6f06c960fb015
parent
5bd69a33e441565b767c43bd66f9082da6a77f4d
download
c10c81127ebb36cc2708c0e3e9c183c8001f7ab1.tar.gz

Fix errors thrown on missing album (soundcloud)



Diff

 src/device.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/device.rs b/src/device.rs
index 97afacb..a81bb29 100644
--- a/src/device.rs
+++ a/src/device.rs
@@ -593,9 +593,7 @@
            artist: element_to_string(metadata
                .get_child("creator")
                .chain_err(|| ErrorKind::ParseError)?),
            album: element_to_string(metadata
                .get_child("album")
                .chain_err(|| ErrorKind::ParseError)?),
            album: metadata.get_child("album").map(element_to_string).unwrap_or_else(|| String::from("Unknown")),
            queue_position: element_to_string(resp.get_child("Track").chain_err(|| ErrorKind::ParseError)?)
                .parse::<u64>()
                .chain_err(|| ErrorKind::ParseError)?,