Remove sort.Interface from models (not used anymore)
This commit is contained in:
parent
19765b0ad8
commit
c404252b7f
|
@ -1,7 +1,5 @@
|
|||
package model
|
||||
|
||||
import "github.com/cloudsonic/sonic-server/utils"
|
||||
|
||||
type ArtistInfo struct {
|
||||
ArtistID string
|
||||
Artist string
|
||||
|
@ -14,13 +12,6 @@ type ArtistIndex struct {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -39,12 +39,6 @@ func (mf *MediaFile) ContentType() string {
|
|||
|
||||
type MediaFiles []MediaFile
|
||||
|
||||
func (a MediaFiles) Len() int { return len(a) }
|
||||
func (a MediaFiles) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a MediaFiles) Less(i, j int) bool {
|
||||
return (a[i].DiscNumber*1000 + a[i].TrackNumber) < (a[j].DiscNumber*1000 + a[j].TrackNumber)
|
||||
}
|
||||
|
||||
type MediaFileRepository interface {
|
||||
CountAll() (int64, error)
|
||||
Exists(id string) (bool, error)
|
||||
|
|
|
@ -57,7 +57,7 @@ func withTx(block func(orm.Ormer) error) error {
|
|||
}
|
||||
|
||||
func initORM(dbPath string) error {
|
||||
verbose := conf.Sonic.LogLevel == "debug"
|
||||
verbose := conf.Sonic.LogLevel == "trace"
|
||||
orm.Debug = verbose
|
||||
orm.RegisterModel(new(Artist))
|
||||
orm.RegisterModel(new(Album))
|
||||
|
|
Loading…
Reference in New Issue