Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused handling of null beatmaps #558

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already checked on L697

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
Loading