diff --git a/cmd/scanner/main.go b/cmd/scanner/main.go index ed28567..a2b9c27 100644 --- a/cmd/scanner/main.go +++ b/cmd/scanner/main.go @@ -10,12 +10,12 @@ import ( "strings" "time" - "github.com/sentriz/gonic/db" - "github.com/dhowden/tag" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/sqlite" "github.com/karrick/godirwalk" + + "github.com/sentriz/gonic/db" ) var ( diff --git a/cmd/server/main.go b/cmd/server/main.go index 8eb9e9d..16446aa 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,12 +6,12 @@ import ( "net/http" "time" + "github.com/gobuffalo/packr/v2" + _ "github.com/jinzhu/gorm/dialects/sqlite" + "github.com/wader/gormstore" + "github.com/sentriz/gonic/db" "github.com/sentriz/gonic/handler" - - "github.com/gobuffalo/packr/v2" - "github.com/wader/gormstore" - _ "github.com/jinzhu/gorm/dialects/sqlite" ) var ( diff --git a/db/model.go b/db/model.go index 277c577..12d1822 100644 --- a/db/model.go +++ b/db/model.go @@ -7,7 +7,7 @@ type Album struct { IDBase CrudBase AlbumArtist AlbumArtist - AlbumArtistID int `gorm:"index"` + AlbumArtistID int `gorm:"index"` Title string `gorm:"not null;index"` Tracks []Track } diff --git a/handler/admin.go b/handler/admin.go index 9eb402b..e5ddc34 100644 --- a/handler/admin.go +++ b/handler/admin.go @@ -6,6 +6,7 @@ import ( "github.com/gorilla/sessions" "github.com/jinzhu/gorm" + "github.com/sentriz/gonic/db" "github.com/sentriz/gonic/handler/utilities" "github.com/sentriz/gonic/lastfm" diff --git a/handler/handler.go b/handler/handler.go index c46f31d..bc0681e 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -10,11 +10,11 @@ import ( "strconv" "github.com/gorilla/sessions" - "github.com/sentriz/gonic/db" - "github.com/sentriz/gonic/subsonic" - "github.com/jinzhu/gorm" "github.com/wader/gormstore" + + "github.com/sentriz/gonic/db" + "github.com/sentriz/gonic/subsonic" ) type Controller struct { diff --git a/handler/media.go b/handler/media.go index 90132e7..4b7b78a 100644 --- a/handler/media.go +++ b/handler/media.go @@ -8,18 +8,17 @@ import ( "unicode" "github.com/jinzhu/gorm" + "github.com/mozillazg/go-unidecode" + "github.com/sentriz/gonic/db" "github.com/sentriz/gonic/lastfm" "github.com/sentriz/gonic/subsonic" - - "github.com/mozillazg/go-unidecode" ) var orderExpr = map[string]interface{}{ - "random": gorm.Expr("random()"), - "newest": "updated_at desc", - "alphabeticalByName": "title", - "alphabeticalByArtist": "album_artist.name", + "random": gorm.Expr("random()"), + "newest": "updated_at desc", + "alphabeticalByName": "title", } func indexOf(s string) rune { diff --git a/handler/middleware.go b/handler/middleware.go index b5b47a1..f571143 100644 --- a/handler/middleware.go +++ b/handler/middleware.go @@ -10,6 +10,7 @@ import ( "github.com/gorilla/sessions" "github.com/jinzhu/gorm" + "github.com/sentriz/gonic/db" ) diff --git a/lastfm/lastfm.go b/lastfm/lastfm.go index e443689..3ecc4c5 100644 --- a/lastfm/lastfm.go +++ b/lastfm/lastfm.go @@ -15,7 +15,7 @@ import ( ) var ( - baseURL = "http://ws.audioscrobbler.com/2.0/" + baseURL = "https://ws.audioscrobbler.com/2.0/" client = &http.Client{ Timeout: 10 * time.Second, }