mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
Update nonebot_plugin_tetris_stats/games/tos/query.py
Some checks failed
TypeCheck / TypeCheck (push) Has been cancelled
Some checks failed
TypeCheck / TypeCheck (push) Has been cancelled
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -231,17 +231,18 @@ async def get_historical_data(unique_identifier: str) -> list[HistoryData]:
|
||||
.order_by(TOSHistoricalData.id.asc())
|
||||
)
|
||||
).all()
|
||||
extra_info = (
|
||||
await session.scalars(
|
||||
select(TOSHistoricalData)
|
||||
.where(TOSHistoricalData.id < user_infos[0].id)
|
||||
.where(TOSHistoricalData.user_unique_identifier == unique_identifier)
|
||||
.where(TOSHistoricalData.api_type == 'User Info')
|
||||
.limit(1)
|
||||
)
|
||||
).one_or_none()
|
||||
if extra_info is not None:
|
||||
user_infos = [extra_info, *user_infos]
|
||||
if user_infos:
|
||||
extra_info = (
|
||||
await session.scalars(
|
||||
select(TOSHistoricalData)
|
||||
.where(TOSHistoricalData.id < user_infos[0].id)
|
||||
.where(TOSHistoricalData.user_unique_identifier == unique_identifier)
|
||||
.where(TOSHistoricalData.api_type == 'User Info')
|
||||
.limit(1)
|
||||
)
|
||||
).one_or_none()
|
||||
if extra_info is not None:
|
||||
user_infos = [extra_info, *user_infos]
|
||||
return [
|
||||
HistoryData(score=float(i.data.data.rating_now), record_at=i.update_time.astimezone(ZoneInfo('Asia/Shanghai')))
|
||||
for i in user_infos
|
||||
|
||||
Reference in New Issue
Block a user