Expose Last.fm's ApiKey to UI

This commit is contained in:
Deluan
2021-06-21 17:09:34 -04:00
committed by Deluan Quintão
parent 143cde37e5
commit 1f997357a9
8 changed files with 30 additions and 22 deletions
+5 -5
View File
@@ -30,13 +30,13 @@ type Router struct {
}
func NewRouter(ds model.DataStore) *Router {
r := &Router{ds: ds, apiKey: lastFMAPIKey, secret: lastFMAPISecret}
r := &Router{
ds: ds,
apiKey: conf.Server.LastFM.ApiKey,
secret: conf.Server.LastFM.Secret,
}
r.sessionKeys = &sessionKeys{ds: ds}
r.Handler = r.routes()
if conf.Server.LastFM.ApiKey != "" {
r.apiKey = conf.Server.LastFM.ApiKey
r.secret = conf.Server.LastFM.Secret
}
r.client = NewClient(r.apiKey, r.secret, "en", http.DefaultClient)
return r
}