From 773f35d55515c85c347115298fd21aaf752adeea Mon Sep 17 00:00:00 2001 From: cmyui Date: Sat, 3 Feb 2024 18:37:18 -0500 Subject: [PATCH] remove unused handling of null beatmaps --- app/api/domains/osu.py | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/app/api/domains/osu.py b/app/api/domains/osu.py index 2c6fca3cc..4d64c7f26 100644 --- a/app/api/domains/osu.py +++ b/app/api/domains/osu.py @@ -804,26 +804,19 @@ async def osuSubmitModularSelector( # now we can calculate things based on our data. score.acc = score.calculate_accuracy() - if score.bmap: - osu_file_path = BEATMAPS_PATH / f"{score.bmap.id}.osu" - if await ensure_local_osu_file( - osu_file_path, - score.bmap.id, - score.bmap.md5, - ): - score.pp, score.sr = score.calculate_performance(osu_file_path) - - if score.passed: - await score.calculate_status() - - if score.bmap.status != RankedStatus.Pending: - score.rank = await score.calculate_placement() - else: - score.status = SubmissionStatus.FAILED - else: - score.pp = score.sr = 0.0 + osu_file_path = BEATMAPS_PATH / f"{score.bmap.id}.osu" + if await ensure_local_osu_file( + osu_file_path, + score.bmap.id, + score.bmap.md5, + ): + score.pp, score.sr = score.calculate_performance(osu_file_path) + if score.passed: - score.status = SubmissionStatus.SUBMITTED + await score.calculate_status() + + if score.bmap.status != RankedStatus.Pending: + score.rank = await score.calculate_placement() else: score.status = SubmissionStatus.FAILED