use references for template data

This commit is contained in:
sentriz
2019-06-06 23:40:23 +01:00
parent cb073a1da4
commit 8123be035c
3 changed files with 4 additions and 4 deletions

BIN
cmd/scanner/main Executable file

Binary file not shown.

BIN
cmd/server/main Executable file

Binary file not shown.

View File

@@ -49,10 +49,10 @@ func (c *Controller) ServeLogout(w http.ResponseWriter, r *http.Request) {
func (c *Controller) ServeHome(w http.ResponseWriter, r *http.Request) {
data := &templateData{}
c.DB.Table("artists").Count(data.ArtistCount)
c.DB.Table("albums").Count(data.AlbumCount)
c.DB.Table("tracks").Count(data.TrackCount)
c.DB.Find(data.AllUsers)
c.DB.Table("artists").Count(&data.ArtistCount)
c.DB.Table("albums").Count(&data.AlbumCount)
c.DB.Table("tracks").Count(&data.TrackCount)
c.DB.Find(&data.AllUsers)
data.CurrentLastFMAPIKey = c.GetSetting("lastfm_api_key")
scheme := firstExisting(
"http", // fallback