summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-06 19:20:09 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-06 19:20:09 -0400
commit53841da448baa28067bab046198757954cebc4a1 (patch)
tree514750df12d2391b77d55b124a8a044b0d4998b1 /web.go
parent81522cbae16c6aadb1b789f3f875dc50f10cc005 (diff)
downloadlastfm-api-53841da448baa28067bab046198757954cebc4a1.tar.gz
Use user_id instead of lfm_name as much as possible
Diffstat (limited to 'web.go')
-rw-r--r--web.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/web.go b/web.go
index c9d27b1..032e04a 100644
--- a/web.go
+++ b/web.go
@@ -20,7 +20,7 @@ type UserInfo struct {
type UserSession struct {
Id string
- UserId int64
+ UserId int
UserName string
}
@@ -43,11 +43,7 @@ func (app *App) root(w http.ResponseWriter, r *http.Request) {
return
}
- var lfmName string
- row := app.DB.QueryRow("SELECT lfm_name FROM users WHERE user_id=$1",
- se.UserId)
- row.Scan(&lfmName)
- scrobbles := app.RecentScrobbles(lfmName)
+ scrobbles := app.RecentScrobbles(se.UserId)
app.Template.ExecuteTemplate(w, "index.tmpl", struct {
Session *UserSession