2016-02-24 11:30:28 -09:00
|
|
|
package models
|
|
|
|
|
|
2016-02-26 23:35:01 -09:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
2016-02-24 11:30:28 -09:00
|
|
|
|
|
|
|
|
type MediaFile struct {
|
2016-02-26 23:35:01 -09:00
|
|
|
Id string
|
|
|
|
|
Path string
|
|
|
|
|
Title string
|
|
|
|
|
Album string
|
|
|
|
|
Artist string
|
|
|
|
|
AlbumArtist string
|
|
|
|
|
Compilation bool
|
|
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m*MediaFile) RealArtist() string {
|
|
|
|
|
if (m.Compilation) {
|
|
|
|
|
return "Various Artists"
|
|
|
|
|
}
|
|
|
|
|
if (m.AlbumArtist != "") {
|
|
|
|
|
return m.AlbumArtist
|
|
|
|
|
}
|
|
|
|
|
return m.Artist
|
2016-02-24 11:30:28 -09:00
|
|
|
}
|