feat(event): replace beatmap url with server url

This commit is contained in:
MingxuanGame
2025-09-13 14:38:43 +00:00
parent ffe4c5b14d
commit 7d0b2c657d
2 changed files with 12 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
from typing import TYPE_CHECKING
from app.config import settings
from app.database.events import Event, EventType
from app.utils import utcnow
@@ -80,7 +81,7 @@ async def process_beatmap_playcount(session: AsyncSession, user_id: int, beatmap
"count": existing_playcount.playcount,
"beatmap": {
"title": existing_playcount.beatmap.version,
"url": existing_playcount.beatmap.url,
"url": existing_playcount.beatmap.url.replace("https://osu.ppy.sh/", settings.web_url),
},
}
session.add(playcount_event)