mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 11:40:36 +03:00
34 lines
729 B
Go
34 lines
729 B
Go
package model
|
|
|
|
import "github.com/cloudsonic/sonic-server/utils"
|
|
|
|
type ArtistInfo struct {
|
|
ArtistID string
|
|
Artist string
|
|
AlbumCount int
|
|
}
|
|
|
|
type ArtistIndex struct {
|
|
ID string
|
|
Artists ArtistInfos
|
|
}
|
|
|
|
type ArtistInfos []ArtistInfo
|
|
|
|
func (a ArtistInfos) Len() int { return len(a) }
|
|
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)
|
|
}
|
|
|
|
type ArtistIndexes []ArtistIndex
|
|
|
|
type ArtistIndexRepository interface {
|
|
CountAll() (int64, error)
|
|
Exists(id string) (bool, error)
|
|
Put(m *ArtistIndex) error
|
|
Get(id string) (*ArtistIndex, error)
|
|
GetAll() (ArtistIndexes, error)
|
|
DeleteAll() error
|
|
}
|