2016-03-02 15:07:24 +01:00
|
|
|
package domain
|
2016-02-26 07:32:31 +01:00
|
|
|
|
2016-03-04 15:09:16 +01:00
|
|
|
import "time"
|
|
|
|
|
2016-02-26 07:32:31 +01:00
|
|
|
type Album struct {
|
2016-02-28 19:50:05 +01:00
|
|
|
Id string
|
|
|
|
Name string
|
2016-02-29 04:56:24 +01:00
|
|
|
ArtistId string `parent:"artist"`
|
2016-03-14 14:41:04 +01:00
|
|
|
CoverArtPath string
|
2016-03-03 16:34:17 +01:00
|
|
|
CoverArtId string
|
2016-03-03 06:25:26 +01:00
|
|
|
Artist string
|
|
|
|
AlbumArtist string
|
2016-03-14 14:41:04 +01:00
|
|
|
Year int `idx:"Year"`
|
2016-02-28 19:50:05 +01:00
|
|
|
Compilation bool
|
2016-03-23 00:00:18 +01:00
|
|
|
Starred bool
|
2016-03-04 23:01:14 +01:00
|
|
|
PlayCount int
|
|
|
|
PlayDate time.Time
|
2016-03-22 02:14:04 +01:00
|
|
|
Duration int
|
2016-02-28 19:50:05 +01:00
|
|
|
Rating int
|
2016-03-03 04:43:31 +01:00
|
|
|
Genre string
|
2016-03-23 00:00:18 +01:00
|
|
|
StarredAt time.Time `idx:"Starred"`
|
2016-03-04 15:09:16 +01:00
|
|
|
CreatedAt time.Time
|
|
|
|
UpdatedAt time.Time
|
2016-03-02 15:33:49 +01:00
|
|
|
}
|
|
|
|
|
2016-03-04 03:01:55 +01:00
|
|
|
type Albums []Album
|
|
|
|
|
2016-03-02 15:33:49 +01:00
|
|
|
type AlbumRepository interface {
|
|
|
|
BaseRepository
|
|
|
|
Put(m *Album) error
|
|
|
|
Get(id string) (*Album, error)
|
2016-03-20 18:14:04 +01:00
|
|
|
FindByArtist(artistId string) (Albums, error)
|
2016-03-20 03:58:20 +01:00
|
|
|
GetAll(QueryOptions) (Albums, error)
|
2016-03-19 00:50:21 +01:00
|
|
|
PurgeInactive(active Albums) ([]string, error)
|
2016-03-20 03:58:20 +01:00
|
|
|
GetAllIds() ([]string, error)
|
2016-03-20 18:14:04 +01:00
|
|
|
GetStarred(QueryOptions) (Albums, error)
|
2016-03-02 19:18:39 +01:00
|
|
|
}
|