Skip to content

Commit

Permalink
Merge pull request #10903 from nanaya/score-params-ranked
Browse files Browse the repository at this point in the history
Add ranked field in score params
  • Loading branch information
notbakaneko authored Jan 29, 2024
2 parents a6fea4e + af12c51 commit 87f5970
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Models/Solo/Score.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Libraries\Score\UserRank;
use App\Libraries\Search\ScoreSearchParams;
use App\Models\Beatmap;
use App\Models\Beatmapset;
use App\Models\Model;
use App\Models\Multiplayer\ScoreLink as MultiplayerScoreLink;
use App\Models\Score as LegacyScore;
Expand Down Expand Up @@ -117,6 +118,12 @@ public static function extractParams(array $rawParams, ScoreToken|MultiplayerSco
$params['started_at'] = $scoreToken->created_at;
$params['user_id'] = $scoreToken->user_id;

$beatmap = $scoreToken->beatmap;
$params['ranked'] = $beatmap !== null && in_array($beatmap->approved, [
Beatmapset::STATES['approved'],
Beatmapset::STATES['ranked'],
], true);

return $params;
}

Expand Down

0 comments on commit 87f5970

Please sign in to comment.