quintodrome/model/album.go

44 lines
976 B
Go
Raw Normal View History

2020-01-14 18:22:34 -09:00
package model
import "time"
type Album struct {
ID string
2016-02-28 09:50:05 -09:00
Name string
2020-01-17 15:36:50 -09:00
ArtistID string
CoverArtPath string
2016-03-03 06:34:17 -09:00
CoverArtId string
2016-03-02 20:25:26 -09:00
Artist string
AlbumArtist string
2020-01-17 15:36:50 -09:00
Year int
2016-02-28 09:50:05 -09:00
Compilation bool
Starred bool
PlayCount int
PlayDate time.Time
2016-03-27 16:13:00 -08:00
SongCount int
2016-03-21 17:14:04 -08:00
Duration int
2016-02-28 09:50:05 -09:00
Rating int
Genre string
2020-01-17 15:36:50 -09:00
StarredAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
2016-03-03 17:01:55 -09:00
type Albums []Album
type AlbumRepository interface {
CountAll() (int64, error)
Exists(id string) (bool, error)
Put(m *Album) error
Get(id string) (*Album, error)
FindByArtist(artistId string) (Albums, error)
GetAll(...QueryOptions) (Albums, error)
GetAllIds() ([]string, error)
GetStarred(...QueryOptions) (Albums, error)
2020-01-13 11:41:14 -09:00
Search(q string, offset int, size int) (Albums, error)
2020-01-16 12:53:48 -09:00
Refresh(ids ...string) error
2020-01-17 19:28:11 -09:00
PurgeEmpty() error
SetStar(star bool, ids ...string) error
MarkAsPlayed(id string, playDate time.Time) error
2016-03-02 09:18:39 -09:00
}