File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
nonebot_plugin_tetris_stats/games/tos Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -231,17 +231,18 @@ async def get_historical_data(unique_identifier: str) -> list[HistoryData]:
231
231
.order_by (TOSHistoricalData .id .asc ())
232
232
)
233
233
).all ()
234
- extra_info = (
235
- await session .scalars (
236
- select (TOSHistoricalData )
237
- .where (TOSHistoricalData .id < user_infos [0 ].id )
238
- .where (TOSHistoricalData .user_unique_identifier == unique_identifier )
239
- .where (TOSHistoricalData .api_type == 'User Info' )
240
- .limit (1 )
241
- )
242
- ).one_or_none ()
243
- if extra_info is not None :
244
- user_infos = [extra_info , * user_infos ]
234
+ if user_infos :
235
+ extra_info = (
236
+ await session .scalars (
237
+ select (TOSHistoricalData )
238
+ .where (TOSHistoricalData .id < user_infos [0 ].id )
239
+ .where (TOSHistoricalData .user_unique_identifier == unique_identifier )
240
+ .where (TOSHistoricalData .api_type == 'User Info' )
241
+ .limit (1 )
242
+ )
243
+ ).one_or_none ()
244
+ if extra_info is not None :
245
+ user_infos = [extra_info , * user_infos ]
245
246
return [
246
247
HistoryData (score = float (i .data .data .rating_now ), record_at = i .update_time .astimezone (ZoneInfo ('Asia/Shanghai' )))
247
248
for i in user_infos
You can’t perform that action at this time.
0 commit comments