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 {
|
2021-08-01 07:21:20 +02:00
|
|
|
Annotations `structs:"-"`
|
2020-05-22 21:23:42 +02:00
|
|
|
|
2021-08-01 07:21:20 +02:00
|
|
|
ID string `structs:"id" json:"id" orm:"column(id)"`
|
|
|
|
Name string `structs:"name" json:"name"`
|
|
|
|
CoverArtPath string `structs:"cover_art_path" json:"coverArtPath"`
|
|
|
|
CoverArtId string `structs:"cover_art_id" json:"coverArtId"`
|
|
|
|
ArtistID string `structs:"artist_id" json:"artistId" orm:"column(artist_id)"`
|
|
|
|
Artist string `structs:"artist" json:"artist"`
|
|
|
|
AlbumArtistID string `structs:"album_artist_id" json:"albumArtistId" orm:"column(album_artist_id)"`
|
|
|
|
AlbumArtist string `structs:"album_artist" json:"albumArtist"`
|
|
|
|
AllArtistIDs string `structs:"all_artist_ids" json:"allArtistIds" orm:"column(all_artist_ids)"`
|
|
|
|
MaxYear int `structs:"max_year" json:"maxYear"`
|
|
|
|
MinYear int `structs:"min_year" json:"minYear"`
|
|
|
|
Compilation bool `structs:"compilation" json:"compilation"`
|
|
|
|
Comment string `structs:"comment" json:"comment,omitempty"`
|
|
|
|
SongCount int `structs:"song_count" json:"songCount"`
|
|
|
|
Duration float32 `structs:"duration" json:"duration"`
|
|
|
|
Size int64 `structs:"size" json:"size"`
|
|
|
|
Genre string `structs:"genre" json:"genre"`
|
|
|
|
Genres Genres `structs:"-" json:"genres"`
|
|
|
|
FullText string `structs:"full_text" json:"fullText"`
|
|
|
|
SortAlbumName string `structs:"sort_album_name" json:"sortAlbumName,omitempty"`
|
|
|
|
SortArtistName string `structs:"sort_artist_name" json:"sortArtistName,omitempty"`
|
|
|
|
SortAlbumArtistName string `structs:"sort_album_artist_name" json:"sortAlbumArtistName,omitempty"`
|
|
|
|
OrderAlbumName string `structs:"order_album_name" json:"orderAlbumName"`
|
|
|
|
OrderAlbumArtistName string `structs:"order_album_artist_name" json:"orderAlbumArtistName"`
|
|
|
|
CatalogNum string `structs:"catalog_num" json:"catalogNum,omitempty"`
|
|
|
|
MbzAlbumID string `structs:"mbz_album_id" json:"mbzAlbumId,omitempty" orm:"column(mbz_album_id)"`
|
|
|
|
MbzAlbumArtistID string `structs:"mbz_album_artist_id" json:"mbzAlbumArtistId,omitempty" orm:"column(mbz_album_artist_id)"`
|
|
|
|
MbzAlbumType string `structs:"mbz_album_type" json:"mbzAlbumType,omitempty"`
|
|
|
|
MbzAlbumComment string `structs:"mbz_album_comment" json:"mbzAlbumComment,omitempty"`
|
2022-12-19 19:09:06 +01:00
|
|
|
ImageFiles string `structs:"image_files" json:"imageFiles,omitempty"`
|
2021-08-01 07:21:20 +02:00
|
|
|
CreatedAt time.Time `structs:"created_at" json:"createdAt"`
|
|
|
|
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"`
|
2016-03-02 15:33:49 +01:00
|
|
|
}
|
|
|
|
|
2021-10-01 16:37:05 +02:00
|
|
|
type (
|
|
|
|
Albums []Album
|
|
|
|
DiscID struct {
|
|
|
|
AlbumID string `json:"albumId"`
|
|
|
|
DiscNumber int `json:"discNumber"`
|
|
|
|
}
|
|
|
|
)
|
2016-03-04 03:01:55 +01:00
|
|
|
|
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)
|
2021-07-16 23:15:34 +02:00
|
|
|
Put(*Album) error
|
2016-03-02 15:33:49 +01:00
|
|
|
Get(id string) (*Album, error)
|
2020-01-12 03:25:37 +01:00
|
|
|
GetAll(...QueryOptions) (Albums, error)
|
2021-11-03 02:18:53 +01:00
|
|
|
GetAllWithoutGenres(...QueryOptions) (Albums, error)
|
2020-01-13 21:41:14 +01:00
|
|
|
Search(q string, offset int, size int) (Albums, error)
|
2020-02-01 03:09:23 +01:00
|
|
|
AnnotatedRepository
|
2016-03-02 19:18:39 +01:00
|
|
|
}
|