refactor(score): replace MODE_TO_INT INT_TO_MODE with int(mode) GameMode.from_int

This commit is contained in:
MingxuanGame
2025-08-14 13:04:59 +00:00
parent a8906b8194
commit 46a1d049fe
11 changed files with 153 additions and 117 deletions

View File

@@ -13,7 +13,7 @@ from app.dependencies.fetcher import get_fetcher
from app.fetcher import Fetcher
from app.models.beatmap import BeatmapRankStatus, Genre, Language
from app.models.mods import int_to_mods
from app.models.score import MODE_TO_INT, GameMode
from app.models.score import GameMode
from .router import AllStrModel, router
@@ -100,7 +100,7 @@ class V1Beatmap(AllStrModel):
total_length=db_beatmap.total_length,
version=db_beatmap.version,
file_md5=db_beatmap.checksum,
mode=MODE_TO_INT[db_beatmap.mode],
mode=int(db_beatmap.mode),
tags=db_beatmap.beatmapset.tags,
favourite_count=(
await session.exec(