Add track duration to Track metadata

This commit is contained in:
ashthespy 2018-02-06 03:20:21 +01:00
parent 977a6db3ef
commit 4164717452

View file

@ -75,6 +75,7 @@ pub trait Metadata : Send + Sized + 'static {
pub struct Track { pub struct Track {
pub id: SpotifyId, pub id: SpotifyId,
pub name: String, pub name: String,
pub duration: i32,
pub album: SpotifyId, pub album: SpotifyId,
pub artists: Vec<SpotifyId>, pub artists: Vec<SpotifyId>,
pub files: LinearMap<FileFormat, FileId>, pub files: LinearMap<FileFormat, FileId>,
@ -127,6 +128,7 @@ impl Metadata for Track {
Track { Track {
id: SpotifyId::from_raw(msg.get_gid()), id: SpotifyId::from_raw(msg.get_gid()),
name: msg.get_name().to_owned(), name: msg.get_name().to_owned(),
duration: msg.get_duration(),
album: SpotifyId::from_raw(msg.get_album().get_gid()), album: SpotifyId::from_raw(msg.get_album().get_gid()),
artists: artists, artists: artists,
files: files, files: files,
@ -215,4 +217,3 @@ impl Metadata for Artist {
} }
} }
} }