Fix logic error preventing changed wiki articles from being checked
This commit is contained in:
parent
e11d613694
commit
8bf5505ffa
7 changed files with 330 additions and 496 deletions
|
@ -135850,24 +135850,21 @@ Disgraced:
|
|||
id: 485360
|
||||
Dishonored:
|
||||
files:
|
||||
<root>/userdata/<storeUserId>/205100:
|
||||
<root>/userdata/<storeUserId>/205100/remote:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
store: steam
|
||||
- store: steam
|
||||
<root>/userdata/<storeUserId>/205100/remote/options.sav:
|
||||
tags:
|
||||
- config
|
||||
when:
|
||||
- os: windows
|
||||
store: steam
|
||||
- store: steam
|
||||
<root>/userdata/<storeUserId>/217980:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
store: steam
|
||||
- store: steam
|
||||
<winDocuments>/My Games/Dishonored/DishonoredGame:
|
||||
tags:
|
||||
- config
|
||||
|
@ -207301,6 +207298,17 @@ Gopnik Simulator:
|
|||
when:
|
||||
- os: windows
|
||||
Gordian Quest:
|
||||
files:
|
||||
<home>/AppData/LocalLow/MixedRealms/GordianQuest/Preferences.json:
|
||||
tags:
|
||||
- config
|
||||
when:
|
||||
- os: windows
|
||||
<home>/AppData/LocalLow/MixedRealms/GordianQuest/Saves:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
installDir:
|
||||
GordianQuest: {}
|
||||
launch:
|
||||
|
@ -207308,6 +207316,10 @@ Gordian Quest:
|
|||
- when:
|
||||
- os: windows
|
||||
store: steam
|
||||
registry:
|
||||
HKEY_CURRENT_USER/Software/MixedRealms/GordianQuest:
|
||||
tags:
|
||||
- config
|
||||
steam:
|
||||
id: 981430
|
||||
'Gordian Rooms: A Curious Heritage':
|
||||
|
@ -222980,6 +222992,11 @@ Hell Wedding 夜嫁:
|
|||
id: 934580
|
||||
Hell Yeah! Wrath of the Dead Rabbit:
|
||||
files:
|
||||
<root>/userdata/<storeUserId>/205230/remote/saves:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- store: steam
|
||||
<winDocuments>/SavedGames/HELLYEAH:
|
||||
tags:
|
||||
- config
|
||||
|
@ -310321,6 +310338,16 @@ Monomyth:
|
|||
- save
|
||||
when:
|
||||
- os: windows
|
||||
Steam/steamapps/common/Monomyth/ProjectAriath/Saved/Config/WindowsNoEditor/GameUserSettings.ini:
|
||||
tags:
|
||||
- config
|
||||
when:
|
||||
- os: windows
|
||||
Steam/steamapps/common/Monomyth/ProjectAriath/Saved/SaveGames:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
steam:
|
||||
id: 908360
|
||||
Monophobia:
|
||||
|
@ -318267,6 +318294,13 @@ My Little Kitties:
|
|||
steam:
|
||||
id: 407320
|
||||
'My Little Pony: A Maretime Bay Adventure':
|
||||
files:
|
||||
<home>/AppData/LocalLow/Melbot Studios/MLP:
|
||||
tags:
|
||||
- config
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
installDir:
|
||||
My Little Pony: {}
|
||||
launch:
|
||||
|
@ -356227,6 +356261,12 @@ Philosophic Love:
|
|||
steam:
|
||||
id: 528060
|
||||
'Phineas and Ferb: New Inventions':
|
||||
files:
|
||||
Documents/PIPE Studio/Phineas and Ferb/SAVES:
|
||||
tags:
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
installDir:
|
||||
Phineas and Ferb New Inventions: {}
|
||||
launch:
|
||||
|
@ -495235,6 +495275,13 @@ The Jackbox Party Pack 5:
|
|||
steam:
|
||||
id: 774461
|
||||
The Jackbox Party Pack 6:
|
||||
files:
|
||||
<winLocalAppData>/Jackbox Games/The Jackbox Party Pack 6/UserData.sav:
|
||||
tags:
|
||||
- config
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
installDir:
|
||||
The Jackbox Party Pack 6: {}
|
||||
launch:
|
||||
|
@ -577688,6 +577735,7 @@ Zzzzz:
|
|||
files:
|
||||
<base>/www/save:
|
||||
tags:
|
||||
- config
|
||||
- save
|
||||
when:
|
||||
- os: windows
|
||||
|
|
|
@ -13066,7 +13066,6 @@
|
|||
* [Goosebumps Dead of Night](https://www.pcgamingwiki.com/wiki/?curid=160744)
|
||||
* [Gopnik Simulator](https://www.pcgamingwiki.com/wiki/?curid=93714)
|
||||
* [GORB](https://www.pcgamingwiki.com/wiki/?curid=60876)
|
||||
* [Gordian Quest](https://www.pcgamingwiki.com/wiki/?curid=150703)
|
||||
* [Gordon Streaman](https://www.pcgamingwiki.com/wiki/?curid=144702)
|
||||
* [Gorescript](https://www.pcgamingwiki.com/wiki/?curid=61554)
|
||||
* [Gorgeous Elves of Ganassa](https://www.pcgamingwiki.com/wiki/?curid=149730)
|
||||
|
@ -20270,7 +20269,6 @@
|
|||
* [My Little Bomb](https://www.pcgamingwiki.com/wiki/?curid=79214)
|
||||
* [My Little Farmies](https://www.pcgamingwiki.com/wiki/?curid=82822)
|
||||
* [My Little Kitties](https://www.pcgamingwiki.com/wiki/?curid=33537)
|
||||
* [My Little Pony: A Maretime Bay Adventure](https://www.pcgamingwiki.com/wiki/?curid=174955)
|
||||
* [My Little Pony: Best Friends Ball](https://www.pcgamingwiki.com/wiki/?curid=166205)
|
||||
* [My Little Pony: Crystal Princess - The Runaway Rainbow](https://www.pcgamingwiki.com/wiki/?curid=138315)
|
||||
* [My Little Pony: Friendship Gardens](https://www.pcgamingwiki.com/wiki/?curid=138065)
|
||||
|
@ -22612,7 +22610,6 @@
|
|||
* [Philia: The Sequel to Elansar](https://www.pcgamingwiki.com/wiki/?curid=45018)
|
||||
* [Philophobia: The Fear of Love](https://www.pcgamingwiki.com/wiki/?curid=154142)
|
||||
* [Philosophic Love](https://www.pcgamingwiki.com/wiki/?curid=104697)
|
||||
* [Phineas and Ferb: New Inventions](https://www.pcgamingwiki.com/wiki/?curid=48629)
|
||||
* [Phlyndir](https://www.pcgamingwiki.com/wiki/?curid=144369)
|
||||
* [Phobia](https://www.pcgamingwiki.com/wiki/?curid=63414)
|
||||
* [Phoenix Dynasty 2](https://www.pcgamingwiki.com/wiki/?curid=67835)
|
||||
|
@ -31384,7 +31381,6 @@
|
|||
* [The Islander: Landscape Designer](https://www.pcgamingwiki.com/wiki/?curid=136397)
|
||||
* [The Isle of the Dead](https://www.pcgamingwiki.com/wiki/?curid=135463)
|
||||
* [The Jackbox Party Pack 3](https://www.pcgamingwiki.com/wiki/?curid=40365)
|
||||
* [The Jackbox Party Pack 6](https://www.pcgamingwiki.com/wiki/?curid=147783)
|
||||
* [The Jackbox Party Pack 7](https://www.pcgamingwiki.com/wiki/?curid=163932)
|
||||
* [The Jackbox Party Pack 8](https://www.pcgamingwiki.com/wiki/?curid=172246)
|
||||
* [The Jackbox Party Starter](https://www.pcgamingwiki.com/wiki/?curid=178634)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
|||
lastCheckedRecentChanges: '2022-07-02T07:51:48.700Z'
|
||||
lastCheckedRecentChanges: '2022-07-02T08:22:42.930Z'
|
||||
|
|
|
@ -14,6 +14,7 @@ interface Cli {
|
|||
irregularPathUntagged?: boolean,
|
||||
skipUntil?: string,
|
||||
recent?: boolean,
|
||||
missing?: boolean,
|
||||
limit?: number,
|
||||
steam?: boolean,
|
||||
}
|
||||
|
@ -27,6 +28,7 @@ async function main() {
|
|||
"all",
|
||||
"irregularPathUntagged",
|
||||
"steam",
|
||||
"missing",
|
||||
],
|
||||
string: [
|
||||
"skipUntil",
|
||||
|
@ -54,7 +56,7 @@ async function main() {
|
|||
if (args.wiki) {
|
||||
if (args.recent) {
|
||||
await wikiCache.flagRecentChanges(wikiMetaCache);
|
||||
} else {
|
||||
} else if (args.missing) {
|
||||
await wikiCache.addNewGames();
|
||||
}
|
||||
|
||||
|
@ -62,6 +64,7 @@ async function main() {
|
|||
args.skipUntil,
|
||||
args.limit ?? DEFAULT_GAME_LIMIT,
|
||||
args.all ?? false,
|
||||
args._ ?? [],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -76,7 +79,7 @@ async function main() {
|
|||
if (args.manifest) {
|
||||
await manifest.updateGames(
|
||||
wikiCache.data,
|
||||
args._,
|
||||
args._ ?? [],
|
||||
steamCache,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -173,13 +173,13 @@ export class ManifestFile extends YamlFile<Manifest> {
|
|||
|
||||
async updateGames(
|
||||
wikiCache: WikiGameCache,
|
||||
games: Array<string> | undefined,
|
||||
games: Array<string>,
|
||||
steamCache: SteamGameCacheFile,
|
||||
): Promise<void> {
|
||||
this.data = {};
|
||||
|
||||
for (const [title, info] of Object.entries(wikiCache).sort()) {
|
||||
if (games !== undefined && games?.length > 0 && !games.includes(title)) {
|
||||
if (games?.length > 0 && !games.includes(title)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
15
src/wiki.ts
15
src/wiki.ts
|
@ -78,7 +78,7 @@ export class WikiGameCacheFile extends YamlFile<WikiGameCache> {
|
|||
};
|
||||
}
|
||||
|
||||
async refresh(skipUntil: string | undefined, limit: number, all: boolean | undefined): Promise<void> {
|
||||
async refresh(skipUntil: string | undefined, limit: number, all: boolean, games: Array<string>): Promise<void> {
|
||||
let i = 0;
|
||||
let foundSkipUntil = false;
|
||||
const client = makeApiClient();
|
||||
|
@ -90,7 +90,9 @@ export class WikiGameCacheFile extends YamlFile<WikiGameCache> {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (!all && (this.data[pageTitle].revId !== null || !this.data[pageTitle].recentlyChanged)) {
|
||||
if (games.length > 0 && !games.includes(pageTitle)) {
|
||||
continue;
|
||||
} else if (!all && this.data[pageTitle].revId !== null && !this.data[pageTitle].recentlyChanged) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -525,7 +527,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, Game]> {
|
||||
export async function getGame(pageTitle: string, cache: WikiGameCache, client: Wikiapi = null): Promise<string> {
|
||||
console.log(pageTitle);
|
||||
const wiki = client === null ? makeApiClient() : client;
|
||||
let page = await wiki.page(pageTitle, { rvprop: "ids|content" });
|
||||
|
@ -563,17 +565,12 @@ export async function getGame(pageTitle: string, cache: WikiGameCache, client: W
|
|||
}
|
||||
}
|
||||
|
||||
const game: Game = {
|
||||
files: {},
|
||||
registry: {},
|
||||
};
|
||||
delete cache[pageTitle].templates;
|
||||
page.parse().each("template", template => {
|
||||
const templateName = template.name.toLowerCase();
|
||||
if (templateName === "Infobox game") {
|
||||
const steamId = Number(template.parameters["steam appid"]);
|
||||
if (!isNaN(steamId) && steamId > 0) {
|
||||
game.steam = { id: steamId };
|
||||
cache[pageTitle].steam = steamId;
|
||||
}
|
||||
} else if (templateName === "game data/saves" || templateName === "game data/config") {
|
||||
|
@ -589,7 +586,7 @@ export async function getGame(pageTitle: string, cache: WikiGameCache, client: W
|
|||
|
||||
cache[pageTitle].revId = page.revisions?.[0]?.revid ?? 0;
|
||||
delete cache[pageTitle].recentlyChanged;
|
||||
return [pageTitle, game];
|
||||
return pageTitle;
|
||||
}
|
||||
|
||||
function flattenParameter(nodes: Array<WikiNode>): [string, boolean] {
|
||||
|
|
Reference in a new issue