use references for template data
This commit is contained in:
BIN
cmd/scanner/main
Executable file
BIN
cmd/scanner/main
Executable file
Binary file not shown.
BIN
cmd/server/main
Executable file
BIN
cmd/server/main
Executable file
Binary file not shown.
@@ -49,10 +49,10 @@ func (c *Controller) ServeLogout(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func (c *Controller) ServeHome(w http.ResponseWriter, r *http.Request) {
|
func (c *Controller) ServeHome(w http.ResponseWriter, r *http.Request) {
|
||||||
data := &templateData{}
|
data := &templateData{}
|
||||||
c.DB.Table("artists").Count(data.ArtistCount)
|
c.DB.Table("artists").Count(&data.ArtistCount)
|
||||||
c.DB.Table("albums").Count(data.AlbumCount)
|
c.DB.Table("albums").Count(&data.AlbumCount)
|
||||||
c.DB.Table("tracks").Count(data.TrackCount)
|
c.DB.Table("tracks").Count(&data.TrackCount)
|
||||||
c.DB.Find(data.AllUsers)
|
c.DB.Find(&data.AllUsers)
|
||||||
data.CurrentLastFMAPIKey = c.GetSetting("lastfm_api_key")
|
data.CurrentLastFMAPIKey = c.GetSetting("lastfm_api_key")
|
||||||
scheme := firstExisting(
|
scheme := firstExisting(
|
||||||
"http", // fallback
|
"http", // fallback
|
||||||
|
|||||||
Reference in New Issue
Block a user