Skip to content

Commit

Permalink
Merge branch 'master' into remove-react-autosize-textbox
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya authored Sep 12, 2023
2 parents 3d67fc8 + 8f25aaf commit 17c81df
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions app/Libraries/Search/BeatmapsetQueryParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static function parse(?string $query): array
case 'creator':
$option = static::makeTextOption($op, $m['value']);
break;
case 'difficulty':
$option = static::makeTextOption($op, $m['value']);
break;
case 'artist':
$option = static::makeTextOption($op, $m['value']);
break;
Expand Down
8 changes: 8 additions & 0 deletions app/Libraries/Search/BeatmapsetSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function getQuery()
$this->addSpotlightsFilter($query);

$nested = new BoolQuery();
$this->addDifficultyFilter($nested);
$this->addStatusFilter($query, $nested);
$this->addManiaKeysFilter($nested);
$this->addModeFilter($nested);
Expand Down Expand Up @@ -166,6 +167,13 @@ private function addCreatorFilter(BoolQuery $query, BoolQuery $nested): void
}
}

private function addDifficultyFilter(BoolQuery $nested)
{
if ($this->params->difficulty !== null) {
$nested->must(QueryHelper::queryString($this->params->difficulty, ['beatmaps.version'], 'and'));
}
}

private function addExtraFilter($query)
{
foreach ($this->params->extra as $val) {
Expand Down
1 change: 1 addition & 0 deletions app/Libraries/Search/BeatmapsetSearchParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BeatmapsetSearchParams extends SearchParams
public ?array $created = null;
public ?string $creator = null;
public ?array $cs = null;
public ?string $difficulty = null;
public ?array $difficultyRating = null;
public ?array $drain = null;
public array $extra = [];
Expand Down
1 change: 1 addition & 0 deletions app/Libraries/Search/BeatmapsetSearchRequestParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ private function parseQuery(): void
'created' => 'created',
'creator' => 'creator',
'cs' => 'cs',
'difficulty' => 'difficulty',
'dr' => 'drain',
'featured_artist' => 'featuredArtist',
'keys' => 'keys',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"karma-sourcemap-loader": "^0.3.8",
"karma-typescript": "^5.5.3",
"karma-webpack": "^5.0.0",
"mobx-react-devtools": "^6.0.3",
"webpack-build-notifier": "^2.3.0"
},
"resolutions": {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5618,11 +5618,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==

mobx-react-devtools@^6.0.3:
version "6.1.1"
resolved "https://registry.yarnpkg.com/mobx-react-devtools/-/mobx-react-devtools-6.1.1.tgz#a462b944085cf11ff96fc937d12bf31dab4c8984"
integrity sha512-nc5IXLdEUFLn3wZal65KF3/JFEFd+mbH4KTz/IG5BOPyw7jo8z29w/8qm7+wiCyqVfUIgJ1gL4+HVKmcXIOgqA==

mobx-react-lite@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/mobx-react-lite/-/mobx-react-lite-3.2.0.tgz#331d7365a6b053378dfe9c087315b4e41c5df69f"
Expand Down

0 comments on commit 17c81df

Please sign in to comment.