Skip to content

Commit

Permalink
Remove lazer score conversion to legacy score
Browse files Browse the repository at this point in the history
The converter function stays because it's still used by transformer.

Removal of the old transformer will be done later. Maybe.
  • Loading branch information
nanaya committed Jan 30, 2024
1 parent 71619ce commit 2d19d39
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 0 additions & 1 deletion app/Http/Controllers/Solo/ScoresController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function store($beatmapId, $tokenId)
if ($scoreToken->score_id === null) {
$params = Score::extractParams($request->all(), $scoreToken);
$score = Score::createFromJsonOrExplode($params);
$score->createLegacyEntryOrExplode();
$scoreToken->fill(['score_id' => $score->getKey()])->saveOrExplode();
} else {
// assume score exists and is valid
Expand Down
9 changes: 0 additions & 9 deletions app/Models/Solo/Score.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,6 @@ public function assertCompleted(): void
}
}

public function createLegacyEntryOrExplode()
{
$score = $this->makeLegacyEntry();

$score->saveOrExplode();

return $score;
}

public function getMode(): string
{
return Beatmap::modeStr($this->ruleset_id);
Expand Down
8 changes: 4 additions & 4 deletions tests/Models/Solo/ScoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testLegacyPassScoreRetainsRank()
$this->assertTrue($score->passed);
$this->assertSame($score->rank, 'S');

$legacy = $score->createLegacyEntryOrExplode();
$legacy = $score->makeLegacyEntry();

$this->assertTrue($legacy->perfect);
$this->assertSame($legacy->rank, 'S');
Expand All @@ -78,7 +78,7 @@ public function testLegacyFailScoreIsRankF()
$this->assertFalse($score->passed);
$this->assertSame($score->rank, 'F');

$legacy = $score->createLegacyEntryOrExplode();
$legacy = $score->makeLegacyEntry();

$this->assertFalse($legacy->perfect);
$this->assertSame($legacy->rank, 'F');
Expand All @@ -98,7 +98,7 @@ public function testLegacyScoreHitCounts()
'statistics' => ['great' => 10, 'ok' => 20, 'meh' => 30, 'miss' => 40],
'total_score' => 1000,
'user_id' => 1,
])->createLegacyEntryOrExplode();
])->makeLegacyEntry();

$this->assertFalse($legacy->perfect);
$this->assertSame($legacy->count300, 10);
Expand All @@ -121,7 +121,7 @@ public function testLegacyScoreHitCountsFromStudlyCaseStatistics()
'statistics' => ['Great' => 10, 'Ok' => 20, 'Meh' => 30, 'Miss' => 40],
'total_score' => 1000,
'user_id' => 1,
])->createLegacyEntryOrExplode();
])->makeLegacyEntry();

$this->assertFalse($legacy->perfect);
$this->assertSame($legacy->count300, 10);
Expand Down

0 comments on commit 2d19d39

Please sign in to comment.