mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-17 12:32:24 +03:00
38 lines
584 B
Go
38 lines
584 B
Go
package scanner
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Track struct {
|
|
Id string
|
|
Path string
|
|
Title string
|
|
Album string
|
|
Artist string
|
|
AlbumArtist string
|
|
Genre string
|
|
TrackNumber int
|
|
DiscNumber int
|
|
Year int
|
|
Size string
|
|
Suffix string
|
|
Duration int
|
|
BitRate int
|
|
Compilation bool
|
|
Loved bool
|
|
AlbumLoved 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
|
|
}
|