From f35bb0a7e8a2d32bf0c000355f7495c41b15aa8b Mon Sep 17 00:00:00 2001 From: Howl Date: Tue, 23 Aug 2016 15:42:59 +0200 Subject: [PATCH] Fix m = 0 killing the query --- app/peppy/beatmap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/peppy/beatmap.go b/app/peppy/beatmap.go index 9b57b82..8119fc2 100644 --- a/app/peppy/beatmap.go +++ b/app/peppy/beatmap.go @@ -28,9 +28,9 @@ func GetBeatmap(c *gin.Context, db *sqlx.DB) { if c.Query("m") != "" { m := genmode(c.Query("m")) if m == "std" { - whereClauses = append(whereClauses, "beatmaps.difficulty_std != 0") - for _, i := range modes[1:] { - whereClauses = append(whereClauses, "beatmaps.difficulty_"+i+" == 0") + // Since STD beatmaps are converted, all of the diffs must be != 0 + for _, i := range modes { + whereClauses = append(whereClauses, "beatmaps.difficulty_"+i+" != 0") } } else { whereClauses = append(whereClauses, "beatmaps.difficulty_"+m+" != 0")