navidrome/domain/mediafile.go

41 lines
732 B
Go
Raw Normal View History

2016-03-02 15:07:24 +01:00
package domain
2016-02-27 09:35:01 +01:00
import (
"time"
"mime"
2016-02-27 09:35:01 +01:00
)
type MediaFile struct {
2016-02-27 09:35:01 +01:00
Id string
Path string
Title string
Album string
Artist string
AlbumArtist string
2016-03-02 19:18:39 +01:00
AlbumId string `parent:"album"`
2016-03-03 16:34:17 +01:00
HasCoverArt bool
TrackNumber int
DiscNumber int
Year int
2016-03-03 05:51:26 +01:00
Size string
Suffix string
Duration int
BitRate int
Genre string
2016-02-27 09:35:01 +01:00
Compilation bool
2016-03-03 07:07:13 +01:00
Starred bool
2016-02-27 09:35:01 +01:00
CreatedAt time.Time
UpdatedAt time.Time
}
func (mf *MediaFile) ContentType() string {
return mime.TypeByExtension("." + mf.Suffix)
}
type MediaFileRepository interface {
BaseRepository
Put(m *MediaFile) error
2016-03-03 18:08:44 +01:00
Get(id string) (*MediaFile, error)
FindByAlbum(albumId string) ([]MediaFile, error)
2016-03-02 19:18:39 +01:00
}