Skip to content

🎧 Your Personal Streaming Service

Remove sort.Interface from models (not used anymore)

Deluanc404252b7fa6
diff --git a/model/index.go b/model/index.go
index 4d8f66505..72d762628 100644
--- a/model/index.go
+++ b/model/index.go
@@ -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 {
diff --git a/model/mediafile.go b/model/mediafile.go
index 94ca73b95..bca96170f 100644
--- a/model/mediafile.go
+++ b/model/mediafile.go
@@ -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)
diff --git a/persistence/sql.go b/persistence/sql.go
index 815154c81..6c29e8785 100644
--- a/persistence/sql.go
+++ b/persistence/sql.go
@@ -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))