2016-03-02 05:07:24 -09:00
|
|
|
package domain
|
|
|
|
|
|
2016-03-03 17:42:12 -09:00
|
|
|
import "github.com/deluan/gosonic/utils"
|
|
|
|
|
|
2016-03-02 05:07:24 -09:00
|
|
|
type ArtistInfo struct {
|
|
|
|
|
ArtistId string
|
2016-03-02 09:18:39 -09:00
|
|
|
Artist string
|
2016-03-02 05:07:24 -09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArtistIndex struct {
|
2016-03-02 09:18:39 -09:00
|
|
|
Id string
|
2016-03-03 17:42:12 -09:00
|
|
|
Artists ArtistInfos
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArtistInfos []ArtistInfo
|
2016-03-08 16:33:09 -09:00
|
|
|
|
|
|
|
|
func (a ArtistInfos) Len() int { return len(a) }
|
2016-03-03 17:42:12 -09: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 05:07:24 -09:00
|
|
|
}
|
|
|
|
|
|
2016-03-03 17:01:55 -09:00
|
|
|
type ArtistIndexes []ArtistIndex
|
|
|
|
|
|
2016-03-02 05:07:24 -09:00
|
|
|
type ArtistIndexRepository interface {
|
2016-03-02 05:33:49 -09:00
|
|
|
BaseRepository
|
2016-03-02 05:07:24 -09:00
|
|
|
Put(m *ArtistIndex) error
|
|
|
|
|
Get(id string) (*ArtistIndex, error)
|
2016-03-08 16:33:09 -09:00
|
|
|
GetAll() (*ArtistIndexes, error)
|
2016-03-02 05:07:24 -09:00
|
|
|
}
|