From 2d19d39e2e7fe02384c0d7277eec42c9f2d97101 Mon Sep 17 00:00:00 2001 From: nanaya Date: Tue, 30 Jan 2024 17:55:57 +0900 Subject: [PATCH] Remove lazer score conversion to legacy score The converter function stays because it's still used by transformer. Removal of the old transformer will be done later. Maybe. --- app/Http/Controllers/Solo/ScoresController.php | 1 - app/Models/Solo/Score.php | 9 --------- tests/Models/Solo/ScoreTest.php | 8 ++++---- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/Solo/ScoresController.php b/app/Http/Controllers/Solo/ScoresController.php index 046c11ec08b..71fff6292e1 100644 --- a/app/Http/Controllers/Solo/ScoresController.php +++ b/app/Http/Controllers/Solo/ScoresController.php @@ -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 diff --git a/app/Models/Solo/Score.php b/app/Models/Solo/Score.php index 9a6599f3122..3bb1e88bf1a 100644 --- a/app/Models/Solo/Score.php +++ b/app/Models/Solo/Score.php @@ -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); diff --git a/tests/Models/Solo/ScoreTest.php b/tests/Models/Solo/ScoreTest.php index 550bc08dd04..663a8da2245 100644 --- a/tests/Models/Solo/ScoreTest.php +++ b/tests/Models/Solo/ScoreTest.php @@ -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'); @@ -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'); @@ -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); @@ -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);