Skip to content

Commit

Permalink
remove unused handling of null beatmaps (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui authored Feb 4, 2024
1 parent e755db1 commit d469c41
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions app/api/domains/osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d469c41

Please sign in to comment.