diff --git a/models/beatmap.go b/models/beatmap.go index 78a8a791508549c4abade13d3fad5f42de520e45..cbe908303fb088790aedfa1a345d72db738d95a2 100644 --- a/models/beatmap.go +++ b/models/beatmap.go @@ -155,7 +155,7 @@ func FetchBeatmapsChimu(db *sql.DB, ids ...int) ([]BeatmapChimu, error) { return nil, nil } - q := `SELECT ` + beatmapFields + `, sets.artist, sets.title, sets.creator FROM beatmaps RIGHT JOIN sets ON sets.id = beatmaps.parent_set_id FROM beatmaps WHERE id IN (` + inClause(len(ids)) + `)` + q := `SELECT ` + beatmapFields + `, sets.artist, sets.title, sets.creator FROM beatmaps RIGHT JOIN sets ON sets.id = beatmaps.parent_set_id WHERE sets.id IN (` + inClause(len(ids)) + `)` rows, err := db.Query(q, sIntToSInterface(ids)...) if err != nil { diff --git a/models/set.go b/models/set.go index f3d63b85cfcf954b017e7bce5e972a6b9001e83b..d9b88c0c2967d17c1a2b65b3b671ca303e30661b 100644 --- a/models/set.go +++ b/models/set.go @@ -137,7 +137,7 @@ func FetchSetChimu(db *sql.DB, id int, withChildren bool) (*SetChimu, error) { return &s, nil } - rows, err := db.Query(`SELECT `+beatmapFields+` FROM beatmaps WHERE parent_set_id = ?`, s.ID) + rows, err := db.Query(`SELECT `+beatmapFields+`, sets.artist, sets.title, sets.creator FROM beatmaps RIGHT JOIN sets ON sets.id = beatmaps.parent_set_id WHERE beatmaps.parent_set_id = ?`, s.ID) if err != nil { return nil, err }