2016-03-02 15:07:24 +01:00
|
|
|
package domain
|
|
|
|
|
2016-03-04 03:42:12 +01:00
|
|
|
import "github.com/deluan/gosonic/utils"
|
|
|
|
|
2016-03-02 15:07:24 +01:00
|
|
|
type ArtistInfo struct {
|
|
|
|
ArtistId string
|
2016-03-02 19:18:39 +01:00
|
|
|
Artist string
|
2016-03-02 15:07:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type ArtistIndex struct {
|
2016-03-02 19:18:39 +01:00
|
|
|
Id string
|
2016-03-04 03:42:12 +01:00
|
|
|
Artists ArtistInfos
|
|
|
|
}
|
|
|
|
|
|
|
|
type ArtistInfos []ArtistInfo
|
2016-03-09 02:33:09 +01:00
|
|
|
|
|
|
|
func (a ArtistInfos) Len() int { return len(a) }
|
2016-03-04 03:42:12 +01:00
|
|
|
func (a ArtistInfos) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
|
|
|
func (a ArtistInfos) Less(i, j int) bool {
|
|
|
|
return utils.NoArticle(a[i].Artist) < utils.NoArticle(a[j].Artist)
|
2016-03-02 15:07:24 +01:00
|
|
|
}
|
|
|
|
|
2016-03-04 03:01:55 +01:00
|
|
|
type ArtistIndexes []ArtistIndex
|
|
|
|
|
2016-03-02 15:07:24 +01:00
|
|
|
type ArtistIndexRepository interface {
|
2016-03-02 15:33:49 +01:00
|
|
|
BaseRepository
|
2016-03-02 15:07:24 +01:00
|
|
|
Put(m *ArtistIndex) error
|
|
|
|
Get(id string) (*ArtistIndex, error)
|
2016-03-20 18:08:24 +01:00
|
|
|
GetAll() (ArtistIndexes, error)
|
2016-03-02 15:07:24 +01:00
|
|
|
}
|