1package model 2 3import "time" 4 5type Album struct { 6 Annotations 7 8 ID string `json:"id" orm:"column(id)"` 9 Name string `json:"name"` 10 CoverArtPath string `json:"coverArtPath"` 11 CoverArtId string `json:"coverArtId"` 12 ArtistID string `json:"artistId" orm:"column(artist_id)"` 13 Artist string `json:"artist"` 14 AlbumArtistID string `json:"albumArtistId" orm:"column(album_artist_id)"` 15 AlbumArtist string `json:"albumArtist"` 16 AllArtistIDs string `json:"allArtistIds" orm:"column(all_artist_ids)"` 17 MaxYear int `json:"maxYear"` 18 MinYear int `json:"minYear"` 19 Compilation bool `json:"compilation"` 20 Comment string `json:"comment"` 21 SongCount int `json:"songCount"` 22 Duration float32 `json:"duration"` 23 Size int64 `json:"size"` 24 Genre string `json:"genre"` 25 FullText string `json:"fullText"` 26 SortAlbumName string `json:"sortAlbumName"` 27 SortArtistName string `json:"sortArtistName"` 28 SortAlbumArtistName string `json:"sortAlbumArtistName"` 29 OrderAlbumName string `json:"orderAlbumName"` 30 OrderAlbumArtistName string `json:"orderAlbumArtistName"` 31 CatalogNum string `json:"catalogNum"` 32 MbzAlbumID string `json:"mbzAlbumId" orm:"column(mbz_album_id)"` 33 MbzAlbumArtistID string `json:"mbzAlbumArtistId" orm:"column(mbz_album_artist_id)"` 34 MbzAlbumType string `json:"mbzAlbumType"` 35 MbzAlbumComment string `json:"mbzAlbumComment"` 36 CreatedAt time.Time `json:"createdAt"` 37 UpdatedAt time.Time `json:"updatedAt"` 38} 39 40type Albums []Album 41 42type AlbumRepository interface { 43 CountAll(...QueryOptions) (int64, error) 44 Exists(id string) (bool, error) 45 Get(id string) (*Album, error) 46 FindByArtist(albumArtistId string) (Albums, error) 47 GetAll(...QueryOptions) (Albums, error) 48 GetRandom(...QueryOptions) (Albums, error) 49 GetStarred(options ...QueryOptions) (Albums, error) 50 Search(q string, offset int, size int) (Albums, error) 51 Refresh(ids ...string) error 52 AnnotatedRepository 53} 54 55func (a Album) GetAnnotations() Annotations { 56 return a.Annotations 57} 58