Populate Steam cache for some missing games
This commit is contained in:
parent
4d8218b042
commit
c0ce36724a
6 changed files with 732 additions and 14 deletions
|
@ -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++;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Reference in a new issue