diff --git a/app/v1/self.go b/app/v1/self.go index 9311bd0..8c8da60 100644 --- a/app/v1/self.go +++ b/app/v1/self.go @@ -59,6 +59,7 @@ type userSettingsData struct { } `json:"custom_badge"` PlayStyle *int `json:"play_style"` VanillaPPLeaderboards *bool `json:"vanilla_pp_leaderboards"` + LeaderboardSize *int `json:"leaderboard_size"` } // UsersSelfSettingsPOST allows to modify information about the current user. @@ -88,7 +89,8 @@ func UsersSelfSettingsPOST(md common.MethodData) common.CodeMessager { Add("custom_badge_icon", d.CustomBadge.Icon). Add("show_custom_badge", d.CustomBadge.Show). Add("play_style", d.PlayStyle). - Add("vanilla_pp_leaderboards", d.VanillaPPLeaderboards) + Add("vanilla_pp_leaderboards", d.VanillaPPLeaderboards). + Add("leaderboard_size", d.LeaderboardSize) _, err := md.DB.Exec("UPDATE users SET "+q.Fields()+" WHERE id = ?", append(q.Parameters, md.ID())...) if err != nil { md.Err(err) @@ -116,7 +118,8 @@ SELECT email, username_aka, favourite_mode, show_custom_badge, custom_badge_icon, custom_badge_name, can_custom_badge, - play_style, vanilla_pp_leaderboards + play_style, vanilla_pp_leaderboards, + leaderboard_size FROM users WHERE id = ?`, md.ID()).Scan( &r.ID, &r.Username, @@ -124,6 +127,7 @@ WHERE id = ?`, md.ID()).Scan( &r.CustomBadge.Show, &r.CustomBadge.Icon, &r.CustomBadge.Name, &ccb, &r.PlayStyle, &r.VanillaPPLeaderboards, + &r.LeaderboardSize, ) if err != nil { md.Err(err)