Skip to content

Commit

Permalink
Merge branch 'master' into ruleset-selector-blade
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko authored Jan 29, 2025
2 parents edb2bf3 + ae70c33 commit c923434
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/BeatmapsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class BeatmapsController extends Controller
{
const DEFAULT_API_INCLUDES = ['beatmapset.ratings', 'failtimes', 'max_combo'];
const DEFAULT_API_INCLUDES = ['beatmapset.ratings', 'failtimes', 'max_combo', 'owners'];
const DEFAULT_SCORE_INCLUDES = ['user', 'user.country', 'user.cover', 'user.team'];

public function __construct()
Expand Down Expand Up @@ -194,7 +194,7 @@ public function attributes($id)
*
* Field | Type | Description
* -------- | ------------------------------------- | -----------
* beatmaps | [BeatmapExtended](#beatmapextended)[] | Includes `beatmapset` (with `ratings`), `failtimes`, and `max_combo`.
* beatmaps | [BeatmapExtended](#beatmapextended)[] | Includes `beatmapset` (with `ratings`), `failtimes`, `max_combo`, and `owners`.
*
* @queryParam ids[] integer Beatmap IDs to be returned. Specify once for each beatmap ID requested. Up to 50 beatmaps can be requested at once. Example: 1
*
Expand All @@ -216,6 +216,7 @@ public function index()
::whereIn('beatmap_id', $ids)
->whereHas('beatmapset')
->with([
'beatmapOwners.user',
'beatmapset',
'beatmapset.userRatings' => fn ($q) => $q->select('beatmapset_id', 'rating'),
'failtimes',
Expand Down
6 changes: 6 additions & 0 deletions app/Libraries/Search/BeatmapsetQueryParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public static function parse(?string $query): array
case 'bpm':
$option = static::makeFloatRangeOption($op, $m['value'], 0.01 / 2);
break;
case 'circles':
$option = static::makeIntRangeOption($op, $m['value']);
break;
case 'sliders':
$option = static::makeIntRangeOption($op, $m['value']);
break;
case 'length':
$parsed = get_length_seconds($m['value']);
if ($parsed !== null) {
Expand Down
2 changes: 2 additions & 0 deletions app/Libraries/Search/BeatmapsetSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ private function addSimpleFilters(BoolQuery $query, BoolQuery $nested): void
'accuracy' => ['field' => 'beatmaps.diff_overall', 'type' => 'range'],
'ar' => ['field' => 'beatmaps.diff_approach', 'type' => 'range'],
'bpm' => ['field' => 'bpm', 'type' => 'range'],
'countNormal' => ['field' => 'beatmaps.countNormal', 'type' => 'range'],
'countSlider' => ['field' => 'beatmaps.countSlider', 'type' => 'range'],
'created' => ['field' => 'submit_date', 'type' => 'range'],
'cs' => ['field' => 'beatmaps.diff_size', 'type' => 'range'],
'difficultyRating' => ['field' => 'beatmaps.difficultyrating', 'type' => 'range'],
Expand Down
2 changes: 2 additions & 0 deletions app/Libraries/Search/BeatmapsetSearchParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class BeatmapsetSearchParams extends SearchParams
public ?array $ar = null;
public ?string $artist = null;
public ?array $bpm = null;
public ?array $countNormal = null;
public ?array $countSlider = null;
public ?array $created = null;
public ?string $creator = null;
public ?array $cs = null;
Expand Down
2 changes: 2 additions & 0 deletions app/Libraries/Search/BeatmapsetSearchRequestParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private function parseQuery(): void
'ar' => 'ar',
'artist' => 'artist',
'bpm' => 'bpm',
'circles' => 'countNormal',
'created' => 'created',
'creator' => 'creator',
'cs' => 'cs',
Expand All @@ -221,6 +222,7 @@ private function parseQuery(): void
'length' => 'totalLength',
'od' => 'accuracy',
'ranked' => 'ranked',
'sliders' => 'countSlider',
'source' => 'source',
'stars' => 'difficultyRating',
'status' => 'statusRange',
Expand Down
2 changes: 1 addition & 1 deletion database/migrations/2015_01_01_133337_base_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ public function up()
});

Schema::create('phpbb_users', function (Blueprint $table) {
$table->mediumIncrements('user_id');
$table->mediumIncrements('user_id')->from(2);
$table->tinyInteger('user_type')->default(0);
$table->mediumInteger('group_id')->unsigned()->default(2);
$table->mediumText('user_permissions');
Expand Down
3 changes: 2 additions & 1 deletion resources/js/docs/sidebar-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default class SidebarToggle {
this.navButton.addEventListener('click', this.onClickNavButton);
}

private readonly onClickNavButton = () => {
private readonly onClickNavButton = (e: MouseEvent) => {
e.preventDefault();
this.menuWrapper.classList.toggle('open');
this.navButton.classList.toggle('open');
};
Expand Down
1 change: 1 addition & 0 deletions resources/views/docs/_structures/beatmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ beatmapset | [Beatmapset](#beatmapset)\|[BeatmapsetExtended](#beatmapsetextende
checksum | string? | |
failtimes | [Failtimes](#beatmap-failtimes) | |
max_combo | integer | |
owners | [BeatmapOwner](#beatmapowner)[] | List of owners (mappers) for the Beatmap.

<div id="beatmap-failtimes" data-unique="beatmap-failtimes"></div>

Expand Down
8 changes: 8 additions & 0 deletions resources/views/docs/_structures/beatmap_owner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## BeatmapOwner

Field | Type | Description
-------- | ------- | ------------
id | integer | [User](#user) id of the Beatmap owner.
username | string | Username of the Beatmap owner.

Users that are no longer visible will still appear as a `BeatmapOwner` but have the `username` set to `[deleted user]`.

0 comments on commit c923434

Please sign in to comment.