Removed duplicated code
This commit is contained in:
@@ -410,31 +410,7 @@ func (api *Router) buildAlbumDirectory(ctx context.Context, album *model.Album)
|
|||||||
|
|
||||||
func (api *Router) buildAlbum(ctx context.Context, album *model.Album, mfs model.MediaFiles) *responses.AlbumWithSongsID3 {
|
func (api *Router) buildAlbum(ctx context.Context, album *model.Album, mfs model.MediaFiles) *responses.AlbumWithSongsID3 {
|
||||||
dir := &responses.AlbumWithSongsID3{}
|
dir := &responses.AlbumWithSongsID3{}
|
||||||
dir.Id = album.ID
|
dir.AlbumID3 = buildAlbumID3(ctx, *album)
|
||||||
dir.Name = album.Name
|
|
||||||
dir.Artist = album.AlbumArtist
|
|
||||||
dir.ArtistId = album.AlbumArtistID
|
|
||||||
dir.CoverArt = album.CoverArtID().String()
|
|
||||||
dir.SongCount = int32(album.SongCount)
|
|
||||||
dir.Duration = int32(album.Duration)
|
|
||||||
dir.PlayCount = album.PlayCount
|
|
||||||
if album.PlayCount > 0 {
|
|
||||||
dir.Played = album.PlayDate
|
|
||||||
}
|
|
||||||
dir.Year = int32(album.MaxYear)
|
|
||||||
dir.Genre = album.Genre
|
|
||||||
dir.Genres = buildItemGenres(album.Genres)
|
|
||||||
dir.DiscTitles = buildDiscSubtitles(ctx, *album)
|
|
||||||
dir.UserRating = int32(album.Rating)
|
|
||||||
if !album.CreatedAt.IsZero() {
|
|
||||||
dir.Created = &album.CreatedAt
|
|
||||||
}
|
|
||||||
if album.Starred {
|
|
||||||
dir.Starred = album.StarredAt
|
|
||||||
}
|
|
||||||
dir.MusicBrainzId = album.MbzAlbumID
|
|
||||||
dir.IsCompilation = album.Compilation
|
|
||||||
dir.SortName = album.SortAlbumName
|
|
||||||
dir.Song = childrenFromMediaFiles(ctx, mfs)
|
dir.Song = childrenFromMediaFiles(ctx, mfs)
|
||||||
return dir
|
return dir
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user