Skip to content

Commit

Permalink
Add missing return and change loud error to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 24, 2024
1 parent 8ed3b16 commit b9d222e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/handlers/beatmaps/beatmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func BeatmapPageHandler(c *gin.Context) {
if _, err := strconv.Atoi(b); err != nil {
c.Error(err)
slog.ErrorContext(c, err.Error())
return
} else {
data.Beatmap, err = bu.GetBeatmapData(b)
if err != nil {
Expand Down Expand Up @@ -56,7 +57,7 @@ func BeatmapPageHandler(c *gin.Context) {
for i := range data.Beatmapset.ChildrenBeatmaps {
err := services.DB.QueryRow("SELECT playcount, passcount FROM beatmaps WHERE beatmap_md5 = ?", data.Beatmapset.ChildrenBeatmaps[i].FileMD5).Scan(&data.Beatmapset.ChildrenBeatmaps[i].Playcount, &data.Beatmapset.ChildrenBeatmaps[i].Passcount)
if err != nil {
slog.Error("Beatmap not found", "error", err.Error())
slog.WarnContext(c, "Could not assign playcount and passcount for child beatmap"+data.Beatmapset.ChildrenBeatmaps[i].FileMD5, "error", err.Error())
data.Beatmapset.ChildrenBeatmaps[i].Playcount = 0
data.Beatmapset.ChildrenBeatmaps[i].Passcount = 0
}
Expand Down

0 comments on commit b9d222e

Please sign in to comment.