2020-01-15 04:22:34 +01:00
|
|
|
package model
|
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 {
|
2020-05-22 21:23:42 +02:00
|
|
|
Annotations
|
|
|
|
|
2020-04-24 16:13:59 +02:00
|
|
|
ID string `json:"id" orm:"column(id)"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
CoverArtPath string `json:"coverArtPath"`
|
|
|
|
CoverArtId string `json:"coverArtId"`
|
|
|
|
ArtistID string `json:"artistId" orm:"pk;column(artist_id)"`
|
|
|
|
Artist string `json:"artist"`
|
|
|
|
AlbumArtistID string `json:"albumArtistId" orm:"pk;column(album_artist_id)"`
|
|
|
|
AlbumArtist string `json:"albumArtist"`
|
|
|
|
MaxYear int `json:"maxYear"`
|
|
|
|
MinYear int `json:"minYear"`
|
|
|
|
Compilation bool `json:"compilation"`
|
|
|
|
SongCount int `json:"songCount"`
|
|
|
|
Duration float32 `json:"duration"`
|
|
|
|
Genre string `json:"genre"`
|
|
|
|
FullText string `json:"fullText"`
|
|
|
|
SortAlbumName string `json:"sortAlbumName"`
|
|
|
|
SortArtistName string `json:"sortArtistName"`
|
|
|
|
SortAlbumArtistName string `json:"sortAlbumArtistName"`
|
|
|
|
OrderAlbumName string `json:"orderAlbumName"`
|
|
|
|
OrderAlbumArtistName string `json:"orderAlbumArtistName"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
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 {
|
2020-01-28 14:22:17 +01:00
|
|
|
CountAll(...QueryOptions) (int64, error)
|
2020-01-15 14:21:32 +01:00
|
|
|
Exists(id string) (bool, error)
|
2016-03-02 15:33:49 +01:00
|
|
|
Get(id string) (*Album, error)
|
2020-03-25 23:51:13 +01:00
|
|
|
FindByArtist(albumArtistId string) (Albums, error)
|
2020-01-12 03:25:37 +01:00
|
|
|
GetAll(...QueryOptions) (Albums, error)
|
2020-01-21 14:49:43 +01:00
|
|
|
GetRandom(...QueryOptions) (Albums, error)
|
2020-01-31 04:07:02 +01:00
|
|
|
GetStarred(options ...QueryOptions) (Albums, error)
|
2020-01-13 21:41:14 +01:00
|
|
|
Search(q string, offset int, size int) (Albums, error)
|
2020-01-16 22:53:48 +01:00
|
|
|
Refresh(ids ...string) error
|
2020-02-01 03:09:23 +01:00
|
|
|
AnnotatedRepository
|
2016-03-02 19:18:39 +01:00
|
|
|
}
|
2020-05-22 21:23:42 +02:00
|
|
|
|
|
|
|
func (a Album) GetAnnotations() Annotations {
|
|
|
|
return a.Annotations
|
|
|
|
}
|