Skip to content

Commit

Permalink
Merge pull request #11831 from nanaya/contest-mania-others
Browse files Browse the repository at this point in the history
Support non-4k/7k mania variant in "best of" contests
  • Loading branch information
notbakaneko authored Jan 31, 2025
2 parents baaac3e + 4542693 commit 64d9d99
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/Models/Contest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,15 @@ public function entriesByType($user = null, array $preloads = [])
});

if ($ruleset === 'mania' && isset($options['variant'])) {
$keys = match ($options['variant']) {
'4k' => 4,
'7k' => 7,
};
$query->where('osu_beatmaps.diff_size', $keys);
if ($options['variant'] === 'nk') {
$query->whereNotIn('osu_beatmaps.diff_size', [4, 7]);
} else {
$keys = match ($options['variant']) {
'4k' => 4,
'7k' => 7,
};
$query->where('osu_beatmaps.diff_size', $keys);
}
}
})->get();
}
Expand Down

0 comments on commit 64d9d99

Please sign in to comment.