2020-01-14 22:22:34 -05:00
|
|
|
package model
|
2016-02-26 01:32:31 -05:00
|
|
|
|
2016-03-04 09:09:16 -05:00
|
|
|
import "time"
|
|
|
|
|
|
2016-02-26 01:32:31 -05:00
|
|
|
type Album struct {
|
2020-01-09 23:33:01 -05:00
|
|
|
ID string
|
2016-02-28 13:50:05 -05:00
|
|
|
Name string
|
2020-01-17 19:36:50 -05:00
|
|
|
ArtistID string
|
2016-03-14 09:41:04 -04:00
|
|
|
CoverArtPath string
|
2016-03-03 10:34:17 -05:00
|
|
|
CoverArtId string
|
2016-03-03 00:25:26 -05:00
|
|
|
Artist string
|
|
|
|
|
AlbumArtist string
|
2020-01-17 19:36:50 -05:00
|
|
|
Year int
|
2016-02-28 13:50:05 -05:00
|
|
|
Compilation bool
|
2016-03-22 19:00:18 -04:00
|
|
|
Starred bool
|
2016-03-04 17:01:14 -05:00
|
|
|
PlayCount int
|
|
|
|
|
PlayDate time.Time
|
2016-03-27 20:13:00 -04:00
|
|
|
SongCount int
|
2016-03-21 21:14:04 -04:00
|
|
|
Duration int
|
2016-02-28 13:50:05 -05:00
|
|
|
Rating int
|
2016-03-02 22:43:31 -05:00
|
|
|
Genre string
|
2020-01-17 19:36:50 -05:00
|
|
|
StarredAt time.Time
|
2016-03-04 09:09:16 -05:00
|
|
|
CreatedAt time.Time
|
|
|
|
|
UpdatedAt time.Time
|
2016-03-02 09:33:49 -05:00
|
|
|
}
|
|
|
|
|
|
2016-03-03 21:01:55 -05:00
|
|
|
type Albums []Album
|
|
|
|
|
|
2016-03-02 09:33:49 -05:00
|
|
|
type AlbumRepository 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 *Album) error
|
|
|
|
|
Get(id string) (*Album, error)
|
2016-03-20 13:14:04 -04:00
|
|
|
FindByArtist(artistId string) (Albums, error)
|
2020-01-11 21:25:37 -05:00
|
|
|
GetAll(...QueryOptions) (Albums, error)
|
2016-03-19 22:58:20 -04:00
|
|
|
GetAllIds() ([]string, error)
|
2020-01-11 21:30:24 -05:00
|
|
|
GetStarred(...QueryOptions) (Albums, error)
|
2020-01-13 15:41:14 -05:00
|
|
|
Search(q string, offset int, size int) (Albums, error)
|
2020-01-16 16:53:48 -05:00
|
|
|
Refresh(ids ...string) error
|
2020-01-17 23:28:11 -05:00
|
|
|
PurgeEmpty() error
|
2020-01-18 20:59:20 -05:00
|
|
|
SetStar(star bool, ids ...string) error
|
|
|
|
|
MarkAsPlayed(id string, playDate time.Time) error
|
2016-03-02 13:18:39 -05:00
|
|
|
}
|