always rank the whole mapset, not just a single diff

This commit is contained in:
Howl 2016-06-09 00:29:00 +02:00
parent b1fc609706
commit d87027c85a

View File

@ -95,24 +95,21 @@ func BeatmapSetStatusPOST(md common.MethodData) common.CodeMessager {
return common.SimpleResponse(400, "ranked status must be 5 < x < -2") return common.SimpleResponse(400, "ranked status must be 5 < x < -2")
} }
var ( param := req.BeatmapsetID
whereClause = "beatmapset_id"
param = req.BeatmapsetID
)
if req.BeatmapID != 0 { if req.BeatmapID != 0 {
whereClause = "beatmap_id" err := md.DB.QueryRow("SELECT beatmapset_id FROM beatmaps WHERE beatmap_id = ? LIMIT 1", req.BeatmapID).Scan(&param)
param = req.BeatmapID if err != nil {
md.Err(err)
return Err500
}
} }
md.DB.Exec(`UPDATE beatmaps md.DB.Exec(`UPDATE beatmaps
SET ranked = ?, ranked_status_freezed = ? SET ranked = ?, ranked_status_freezed = ?
WHERE `+whereClause+` = ?`, req.RankedStatus, req.Frozen, param) WHERE beatmapset_id = ?`, req.RankedStatus, req.Frozen, param)
if whereClause == "beatmapset_id" {
return getSet(md, param) return getSet(md, param)
} }
return getBeatmap(md, param)
}
// BeatmapGET retrieves a beatmap. // BeatmapGET retrieves a beatmap.
func BeatmapGET(md common.MethodData) common.CodeMessager { func BeatmapGET(md common.MethodData) common.CodeMessager {