2020-01-14 22:22:34 -05:00
|
|
|
package model
|
2016-02-26 01:32:31 -05:00
|
|
|
|
2020-01-18 20:03:52 -05:00
|
|
|
import "time"
|
|
|
|
|
|
2016-02-26 01:32:31 -05:00
|
|
|
type Artist struct {
|
2020-01-09 23:33:01 -05:00
|
|
|
ID string
|
2016-03-27 20:13:00 -04:00
|
|
|
Name string
|
|
|
|
|
AlbumCount int
|
2020-01-18 20:03:52 -05:00
|
|
|
Starred bool
|
|
|
|
|
StarredAt time.Time
|
2016-03-02 09:33:49 -05:00
|
|
|
}
|
2020-01-17 20:46:19 -05:00
|
|
|
type Artists []Artist
|
|
|
|
|
|
|
|
|
|
type ArtistIndex struct {
|
|
|
|
|
ID string
|
|
|
|
|
Artists Artists
|
|
|
|
|
}
|
|
|
|
|
type ArtistIndexes []ArtistIndex
|
2016-03-02 09:33:49 -05:00
|
|
|
|
|
|
|
|
type ArtistRepository interface {
|
2020-01-15 08:21:32 -05:00
|
|
|
CountAll() (int64, error)
|
|
|
|
|
Exists(id string) (bool, error)
|
2016-03-02 09:33:49 -05:00
|
|
|
Put(m *Artist) error
|
|
|
|
|
Get(id string) (*Artist, error)
|
2020-01-18 20:03:52 -05:00
|
|
|
GetStarred(...QueryOptions) (Artists, error)
|
|
|
|
|
SetStar(star bool, ids ...string) error
|
2020-01-13 16:02:49 -05:00
|
|
|
Search(q string, offset int, size int) (Artists, error)
|
2020-01-16 16:53:48 -05:00
|
|
|
Refresh(ids ...string) error
|
2020-01-17 20:46:19 -05:00
|
|
|
GetIndex() (ArtistIndexes, error)
|
2020-01-17 23:28:11 -05:00
|
|
|
PurgeEmpty() error
|
2016-03-02 09:33:49 -05:00
|
|
|
}
|