소스 검색

Merge pull request #121 from ashthespy/metadata

Add track duration to `Track` metadata
Sasha Hilton 7 년 전
부모
커밋
578d6b7f06
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      metadata/src/lib.rs

+ 2 - 1
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<SpotifyId>,
     pub files: LinearMap<FileFormat, FileId>,
@@ -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 {
         }
     }
 }
-