Adding Album total time (Duration)

This commit is contained in:
Deluan 2016-03-21 21:14:04 -04:00
parent cdcb5c6f49
commit 2a2af2f57a
3 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,7 @@ type Album struct {
Starred bool `idx:"Starred"`
PlayCount int
PlayDate time.Time
Duration int
Rating int
Genre string
CreatedAt time.Time

View File

@ -64,6 +64,7 @@ func FromAlbum(al *domain.Album) Entry {
c.AlbumId = al.Id
c.ArtistId = al.ArtistId
c.UserRating = al.Rating
c.Duration = al.Duration
return c
}

View File

@ -263,6 +263,7 @@ func (s *ItunesScanner) collectAlbums(t *itl.Track, mf *domain.MediaFile, ar *do
al.Genre = mf.Genre
al.Artist = mf.Artist
al.AlbumArtist = ar.Name
al.Duration += mf.Duration
if mf.HasCoverArt {
al.CoverArtId = mf.Id