mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🐛 修复 茶服 没有 40l 记录时数值显示错误的bug
This commit is contained in:
@@ -199,8 +199,15 @@ async def get_game_data(player: Player, query_num: int = 50) -> GameData | None:
|
|||||||
|
|
||||||
async def make_query_image(user_info: UserInfoSuccess, game_data: GameData, event_user_info: UserInfo) -> bytes:
|
async def make_query_image(user_info: UserInfoSuccess, game_data: GameData, event_user_info: UserInfo) -> bytes:
|
||||||
metrics = game_data.metrics
|
metrics = game_data.metrics
|
||||||
duration = timedelta(milliseconds=float(user_info.data.pb_sprint)).total_seconds()
|
sprint_value = (
|
||||||
sprint_value = f'{duration:.3f}s' if duration < 60 else f'{duration // 60:.0f}m {duration % 60:.3f}s' # noqa: PLR2004
|
(
|
||||||
|
f'{duration:.3f}s'
|
||||||
|
if (duration := timedelta(milliseconds=float(user_info.data.pb_sprint)).total_seconds()) < 60 # noqa: PLR2004
|
||||||
|
else f'{duration // 60:.0f}m {duration % 60:.3f}s'
|
||||||
|
)
|
||||||
|
if user_info.data.pb_sprint != '2147483647'
|
||||||
|
else 'N/A'
|
||||||
|
)
|
||||||
async with HostPage(
|
async with HostPage(
|
||||||
await render(
|
await render(
|
||||||
'v1/tos/info',
|
'v1/tos/info',
|
||||||
|
|||||||
Reference in New Issue
Block a user