navidrome/domain/index.go

31 lines
638 B
Go
Raw Normal View History

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
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 {
BaseRepository
2016-03-02 15:07:24 +01:00
Put(m *ArtistIndex) error
Get(id string) (*ArtistIndex, error)
GetAll() (ArtistIndexes, error)
2016-03-02 15:07:24 +01:00
}