Skip to content

Commit

Permalink
Support non-4k/7k mania variant in "best of" contests
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Jan 31, 2025
1 parent baaac3e commit 4542693
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 4542693

Please sign in to comment.