Send NowPlaying and Scrobbles to Last.fm

This commit is contained in:
Deluan
2021-06-22 14:00:44 -04:00
committed by Deluan Quintão
parent d5461d0ae9
commit a7509c9ff7
15 changed files with 503 additions and 78 deletions
+10 -5
View File
@@ -7,6 +7,8 @@ import (
"net/http"
"time"
"github.com/navidrome/navidrome/consts"
"github.com/deluan/rest"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
@@ -32,13 +34,16 @@ type Router struct {
func NewRouter(ds model.DataStore) *Router {
r := &Router{
ds: ds,
apiKey: conf.Server.LastFM.ApiKey,
secret: conf.Server.LastFM.Secret,
ds: ds,
apiKey: conf.Server.LastFM.ApiKey,
secret: conf.Server.LastFM.Secret,
sessionKeys: &sessionKeys{ds: ds},
}
r.sessionKeys = &sessionKeys{ds: ds}
r.Handler = r.routes()
r.client = NewClient(r.apiKey, r.secret, "en", http.DefaultClient)
hc := &http.Client{
Timeout: consts.DefaultHttpClientTimeOut,
}
r.client = NewClient(r.apiKey, r.secret, "en", hc)
return r
}