From 41647174527f553460f3aa4dbd357dbb7b7a37c2 Mon Sep 17 00:00:00 2001 From: ashthespy Date: Tue, 6 Feb 2018 03:20:21 +0100 Subject: [PATCH] Add track duration to `Track` metadata --- metadata/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index f76cd22..2439ded 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -75,6 +75,7 @@ pub trait Metadata : Send + Sized + 'static { pub struct Track { pub id: SpotifyId, pub name: String, + pub duration: i32, pub album: SpotifyId, pub artists: Vec, pub files: LinearMap, @@ -127,6 +128,7 @@ impl Metadata for Track { Track { id: SpotifyId::from_raw(msg.get_gid()), name: msg.get_name().to_owned(), + duration: msg.get_duration(), album: SpotifyId::from_raw(msg.get_album().get_gid()), artists: artists, files: files, @@ -215,4 +217,3 @@ impl Metadata for Artist { } } } -