feat: add more and unify stats

Release-As: 0.16.1
This commit is contained in:
sentriz
2023-10-28 21:22:08 +01:00
committed by Senan Kelly
parent c1a34dc021
commit 2fdc1f41a2
5 changed files with 32 additions and 17 deletions

View File

@@ -36,9 +36,7 @@ func (c *Controller) ServeHome(r *http.Request) *Response {
data := &templateData{}
// stats box
c.dbc.Model(&db.Artist{}).Count(&data.ArtistCount)
c.dbc.Model(&db.Album{}).Count(&data.AlbumCount)
c.dbc.Table("tracks").Count(&data.TrackCount)
data.Stats, _ = c.dbc.Stats()
// lastfm box
data.RequestRoot = handlerutil.BaseURL(r)
data.CurrentLastFMAPIKey, _ = c.dbc.GetSetting(db.LastFMAPIKey)