File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ if (!ENABLE_REQUEST) {
2020 return ;
2121}
2222const DELAY_MS = 1000 ;
23- const appidList = await steamApi .playedGames ();
23+ const appidList = (await steamApi .playedGames ()).filter ((game ) => game .playtime_forever > 200 );;
24+ let count = 1 ;
2425for (const game of appidList ) {
26+ console .log (` 请求 ${game .appid } 中 ${count ++ }/${appidList .length } ` );
2527 await delay (DELAY_MS );
2628 const gameDetail = await steamApi .appdetails (game .appid );
2729 playedGames .push ({
@@ -32,15 +34,14 @@ for (const game of appidList) {
3234 app .appid .toString () == game .appid
3335 )?.name || " " ,
3436 // imgurl: steamApi.imageUrl(game.appid.toString()),
35- imgurl: gameDetail [game .appid ].data .header_image ,
37+ imgurl: gameDetail [game .appid ]? .data ? .header_image ,
3638 });
3739}
3840
3941orderGames .forEach ((game ) => ` ${import .meta .env .SITE }${game .imgurl } ` );
4042
4143playedGames = playedGames
4244 .concat (orderGames )
43- .filter ((game ) => game .playtime_forever > 200 )
4445 .sort ((a , b ) => b .playtime_forever - a .playtime_forever );
4546---
4647
You can’t perform that action at this time.
0 commit comments