mirror of
https://github.com/navidrome/navidrome.git
synced 2025-08-10 00:52:20 +00:00
Adding Album total time (Duration)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user