2020-01-14 18:22:34 -09:00
|
|
|
package model
|
2016-02-25 21:32:31 -09:00
|
|
|
|
2016-03-04 05:09:16 -09:00
|
|
|
import "time"
|
|
|
|
|
|
2016-02-25 21:32:31 -09:00
|
|
|
type Album struct {
|
2020-01-09 19:33:01 -09:00
|
|
|
ID string
|
2016-02-28 09:50:05 -09:00
|
|
|
Name string
|
2020-01-17 15:36:50 -09:00
|
|
|
ArtistID string
|
2016-03-14 05:41:04 -08:00
|
|
|
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
|
2016-03-22 15:00:18 -08:00
|
|
|
Starred bool
|
2016-03-04 13:01:14 -09:00
|
|
|
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
|
2016-03-02 18:43:31 -09:00
|
|
|
Genre string
|
2020-01-17 15:36:50 -09:00
|
|
|
StarredAt time.Time
|
2016-03-04 05:09:16 -09:00
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
2016-03-02 05:33:49 -09:00
|
|
|
}
|
|
|
|
|
|
2016-03-03 17:01:55 -09:00
|
|
|
type Albums []Album
|
|
|
|
|
|
2016-03-02 05:33:49 -09:00
|
|
|
type AlbumRepository interface {
|
2020-01-15 04:21:32 -09:00
|
|
|
CountAll() (int64, error)
|
|
|
|
|
Exists(id string) (bool, error)
|
2016-03-02 05:33:49 -09:00
|
|
|
Put(m *Album) error
|
|
|
|
|
Get(id string) (*Album, error)
|
2016-03-20 09:14:04 -08:00
|
|
|
FindByArtist(artistId string) (Albums, error)
|
2020-01-11 17:25:37 -09:00
|
|
|
GetAll(...QueryOptions) (Albums, error)
|
2016-03-19 18:58:20 -08:00
|
|
|
GetAllIds() ([]string, error)
|
2020-01-11 17:30:24 -09:00
|
|
|
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
|
2020-01-18 16:59:20 -09:00
|
|
|
SetStar(star bool, ids ...string) error
|
|
|
|
|
MarkAsPlayed(id string, playDate time.Time) error
|
2016-03-02 09:18:39 -09:00
|
|
|
}
|