More metadata for children (albums/mediafiles)

This commit is contained in:
Deluan
2016-03-21 09:50:46 -04:00
parent 37f72f2efc
commit 5fd9da505e
5 changed files with 42 additions and 14 deletions
+18
View File
@@ -24,6 +24,13 @@ type Entry struct {
Suffix string
BitRate int
ContentType string
Path string
PlayCount int32
DiscNumber int
Created time.Time
AlbumId string
ArtistId string
Type string
UserName string
MinutesAgo int
@@ -51,6 +58,10 @@ func FromAlbum(al *domain.Album) Entry {
if al.Starred {
c.Starred = al.UpdatedAt
}
c.PlayCount = int32(al.PlayCount)
c.Created = al.CreatedAt
c.AlbumId = al.Id
c.ArtistId = al.ArtistId
return c
}
@@ -76,5 +87,12 @@ func FromMediaFile(mf *domain.MediaFile) Entry {
c.CoverArt = mf.Id
}
c.ContentType = mf.ContentType()
c.Path = mf.Path
c.PlayCount = int32(mf.PlayCount)
c.DiscNumber = mf.DiscNumber
c.Created = mf.CreatedAt
c.AlbumId = mf.AlbumId
c.ArtistId = mf.ArtistId
c.Type = "music" // TODO Hardcoded for now
return c
}