Work on #16 - add PCGW gogcom_id to manifest

This commit is contained in:
Sascha Lüdecke 2022-11-01 12:19:03 +01:00
parent c9be033706
commit 555f869dfa
4 changed files with 22 additions and 0 deletions

View file

@ -37,6 +37,8 @@ export type WikiGameCache = {
renamedFrom?: Array<string>,
templates?: Array<string>,
steam?: number,
gog?: number
};
};
@ -587,6 +589,10 @@ export async function getGame(pageTitle: string, cache: WikiGameCache, client: W
if (!isNaN(steamId) && steamId > 0) {
cache[pageTitle].steam = steamId;
}
const gogId = Number(template.parameters["gogcom id"]);
if (!isNaN(gogId) && gogId > 0) {
cache[pageTitle].gog = gogId
}
} else if (templateName === "game data/saves" || templateName === "game data/config") {
const reparsed = parseWiki(template.toString());
if (reparsed[0].positionalParameters[1]?.length > 0 ?? false) {