diff --git a/app/peppy/user.go b/app/peppy/user.go index 0bbdc09..0f4a90c 100644 --- a/app/peppy/user.go +++ b/app/peppy/user.go @@ -23,6 +23,7 @@ func GetUser(c *gin.Context, db *sqlx.DB) { mode := genmode(c.Query("m")) + var lbpos *int err := db.QueryRow(fmt.Sprintf( `SELECT users.id, users.username, @@ -38,7 +39,7 @@ func GetUser(c *gin.Context, db *sqlx.DB) { ), p).Scan( &user.UserID, &user.Username, &user.Playcount, &user.RankedScore, &user.TotalScore, - &user.Rank, &user.PP, &user.Accuracy, + &lbpos, &user.PP, &user.Accuracy, &user.Country, ) if err != nil { @@ -48,6 +49,9 @@ func GetUser(c *gin.Context, db *sqlx.DB) { } return } + if lbpos != nil { + user.Rank = *lbpos + } user.Level = ocl.GetLevelPrecise(user.TotalScore) c.JSON(200, []osuapi.User{user}) diff --git a/app/recovery.go b/app/recovery.go index c4561c4..4a35a0c 100644 --- a/app/recovery.go +++ b/app/recovery.go @@ -8,7 +8,7 @@ import ( "io/ioutil" "net/http" - "github.com/getsentry/raven-go" + raven "github.com/getsentry/raven-go" "github.com/gin-gonic/gin" ) @@ -32,8 +32,8 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc { } ravenUser := &raven.User{ - ID: token, - IP: c.Request.RemoteAddr, + Username: token, + IP: c.Request.RemoteAddr, } flags := map[string]string{