Populate Steam cache for some missing games

This commit is contained in:
mtkennerly 2022-07-05 17:52:59 +08:00
parent 4d8218b042
commit c0ce36724a
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
6 changed files with 732 additions and 14 deletions

View file

@ -1,5 +1,5 @@
import { DELAY_BETWEEN_GAMES_MS, REPO, YamlFile } from ".";
import * as SteamUser from "steam-user";
import SteamUser from "steam-user";
export type SteamGameCache = {
[appId: string]: {
@ -45,6 +45,8 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
return this.data[key];
}
console.log(`Steam: ${appId}`);
if (this.steamClient === null) {
this.steamClient = await this.makeSteamClient();
}
@ -108,7 +110,7 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
}
}
console.log(`Refreshing Steam app ${appId}`);
// console.log(`Refreshing Steam app ${appId}`);
await this.getAppInfo(parseInt(appId), true);
i++;

View file

@ -530,7 +530,7 @@ export async function getRecentChanges(newest: Date, oldest: Date): Promise<Rece
* https://www.pcgamingwiki.com/wiki/Template:Game_data
*/
export async function getGame(pageTitle: string, cache: WikiGameCache, client: Wikiapi = null): Promise<string> {
console.log(pageTitle);
console.log(`Wiki: ${pageTitle}`);
const wiki = client === null ? makeApiClient() : client;
let page = await wiki.page(pageTitle, { rvprop: "ids|content" });
if (page.missing !== undefined) {