update importst
This commit is contained in:
@@ -10,12 +10,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sentriz/gonic/db"
|
|
||||||
|
|
||||||
"github.com/dhowden/tag"
|
"github.com/dhowden/tag"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||||
"github.com/karrick/godirwalk"
|
"github.com/karrick/godirwalk"
|
||||||
|
|
||||||
|
"github.com/sentriz/gonic/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"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/db"
|
||||||
"github.com/sentriz/gonic/handler"
|
"github.com/sentriz/gonic/handler"
|
||||||
|
|
||||||
"github.com/gobuffalo/packr/v2"
|
|
||||||
"github.com/wader/gormstore"
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type Album struct {
|
|||||||
IDBase
|
IDBase
|
||||||
CrudBase
|
CrudBase
|
||||||
AlbumArtist AlbumArtist
|
AlbumArtist AlbumArtist
|
||||||
AlbumArtistID int `gorm:"index"`
|
AlbumArtistID int `gorm:"index"`
|
||||||
Title string `gorm:"not null;index"`
|
Title string `gorm:"not null;index"`
|
||||||
Tracks []Track
|
Tracks []Track
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/sessions"
|
"github.com/gorilla/sessions"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
|
|
||||||
"github.com/sentriz/gonic/db"
|
"github.com/sentriz/gonic/db"
|
||||||
"github.com/sentriz/gonic/handler/utilities"
|
"github.com/sentriz/gonic/handler/utilities"
|
||||||
"github.com/sentriz/gonic/lastfm"
|
"github.com/sentriz/gonic/lastfm"
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/gorilla/sessions"
|
"github.com/gorilla/sessions"
|
||||||
"github.com/sentriz/gonic/db"
|
|
||||||
"github.com/sentriz/gonic/subsonic"
|
|
||||||
|
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
"github.com/wader/gormstore"
|
"github.com/wader/gormstore"
|
||||||
|
|
||||||
|
"github.com/sentriz/gonic/db"
|
||||||
|
"github.com/sentriz/gonic/subsonic"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Controller struct {
|
type Controller struct {
|
||||||
|
|||||||
@@ -8,18 +8,17 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
|
"github.com/mozillazg/go-unidecode"
|
||||||
|
|
||||||
"github.com/sentriz/gonic/db"
|
"github.com/sentriz/gonic/db"
|
||||||
"github.com/sentriz/gonic/lastfm"
|
"github.com/sentriz/gonic/lastfm"
|
||||||
"github.com/sentriz/gonic/subsonic"
|
"github.com/sentriz/gonic/subsonic"
|
||||||
|
|
||||||
"github.com/mozillazg/go-unidecode"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var orderExpr = map[string]interface{}{
|
var orderExpr = map[string]interface{}{
|
||||||
"random": gorm.Expr("random()"),
|
"random": gorm.Expr("random()"),
|
||||||
"newest": "updated_at desc",
|
"newest": "updated_at desc",
|
||||||
"alphabeticalByName": "title",
|
"alphabeticalByName": "title",
|
||||||
"alphabeticalByArtist": "album_artist.name",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func indexOf(s string) rune {
|
func indexOf(s string) rune {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/sessions"
|
"github.com/gorilla/sessions"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
|
|
||||||
"github.com/sentriz/gonic/db"
|
"github.com/sentriz/gonic/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
baseURL = "http://ws.audioscrobbler.com/2.0/"
|
baseURL = "https://ws.audioscrobbler.com/2.0/"
|
||||||
client = &http.Client{
|
client = &http.Client{
|
||||||
Timeout: 10 * time.Second,
|
Timeout: 10 * time.Second,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user