From 53841da448baa28067bab046198757954cebc4a1 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Tue, 6 Jun 2017 19:20:09 -0400 Subject: Use user_id instead of lfm_name as much as possible --- apiv1.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apiv1.go') diff --git a/apiv1.go b/apiv1.go index 892c06b..592e7de 100644 --- a/apiv1.go +++ b/apiv1.go @@ -36,14 +36,14 @@ func (app *App) mainHandler(w http.ResponseWriter, r *http.Request) { user := r.FormValue("u") auth := r.FormValue("a") - password, err := app.GetPassword(user) + userId, password, err := app.GetUser(user) if (md5hex(password+timestamp) != auth) || err != nil { fmt.Fprintln(w, "BADAUTH") return } s := &Session{ - User: user, + UserId: userId, Client: r.FormValue("c"), ClientVersion: r.FormValue("v"), Key: randomToken(16), @@ -162,6 +162,7 @@ func parseScrobbles(values url.Values, session *Session) ([]Scrobble, int) { ignored++ } else { scrobble.Session = session.Key + scrobble.UserId = session.UserId scrobbles = append(scrobbles, scrobble) } } -- cgit v1.2.3-70-g09d2