navidrome/scanner/track.go

28 lines
423 B
Go
Raw Normal View History

package scanner
import (
"time"
)
type Track struct {
2016-02-27 09:35:01 +01:00
Id string
Path string
Title string
Album string
Artist string
AlbumArtist string
2016-02-28 19:50:05 +01:00
Year int
2016-02-27 09:35:01 +01:00
Compilation bool
CreatedAt time.Time
UpdatedAt time.Time
}
func (m *Track) RealArtist() string {
if (m.Compilation) {
return "Various Artists"
}
if (m.AlbumArtist != "") {
return m.AlbumArtist
}
return m.Artist
}