Split steamId into an object and add --unchecked flag
This commit is contained in:
parent
f2a461f1a0
commit
d715380e0b
9 changed files with 471 additions and 193 deletions
|
@ -5,8 +5,9 @@ Requires Node.js.
|
|||
* `npm run cache`
|
||||
* Update the manifest with games from the cache (`--limit 25` is default at a time):
|
||||
* All games in cache: `npm run manifest -- --all`
|
||||
* Games missing from manifest: `npm run manifest -- --missing`
|
||||
* Games already in the manifest: `npm run manifest -- --existing`
|
||||
* Games missing from manifest: `npm run manifest -- --missing`
|
||||
* Games not yet checked on the wiki: `npm run manifest -- --unchecked`
|
||||
* Games that had an unknown OS: `npm run manifest -- --unsuportedOs`
|
||||
* Games that had an unusable path: `npm run manifest -- --unsupportedPath`
|
||||
* A specific game: `npm run manifest -- --game "Name of Game"`
|
||||
|
|
|
@ -50,7 +50,8 @@ An Example Game:
|
|||
tags:
|
||||
- save
|
||||
- config
|
||||
steamId: 123
|
||||
steam:
|
||||
id: 123
|
||||
```
|
||||
|
||||
This means:
|
||||
|
@ -78,8 +79,8 @@ Paths can include these placeholders:
|
|||
| `<winDir>` | `%WINDIR%` on Windows |
|
||||
| `<xdgData>` | `$XDG_DATA_HOME` on Linux |
|
||||
| `<xdgConfig>` | `$XDG_CONFIG_HOME` on Linux |
|
||||
| `regHkcu` | `HKEY_CURRENT_USER` in the Windows registry |
|
||||
| `regHklm` | `HKEY_LOCAL_MACHINE` in the Windows registry |
|
||||
| `<regHkcu>` | `HKEY_CURRENT_USER` in the Windows registry |
|
||||
| `<regHklm>` | `HKEY_LOCAL_MACHINE` in the Windows registry |
|
||||
|
||||
## Implementation
|
||||
Tools must implement the following in addition to respecting the schema:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -469,7 +469,6 @@
|
|||
* [A Legionary's Life](https://www.pcgamingwiki.com/wiki/?curid=134830)
|
||||
* [A Lenda do Herói](https://www.pcgamingwiki.com/wiki/?curid=38191)
|
||||
* [A Light in the Dark](https://www.pcgamingwiki.com/wiki/?curid=87557)
|
||||
* [A Little Lily Princess](https://www.pcgamingwiki.com/wiki/?curid=34700)
|
||||
* [A Little Rabbit Story](https://www.pcgamingwiki.com/wiki/?curid=80968)
|
||||
* [A Long Night For Crazy King](https://www.pcgamingwiki.com/wiki/?curid=150754)
|
||||
* [A Long Road Home](https://www.pcgamingwiki.com/wiki/?curid=56912)
|
||||
|
@ -21089,7 +21088,6 @@
|
|||
* [Lone Echo](https://www.pcgamingwiki.com/wiki/?curid=128780)
|
||||
* [Lone Leader](https://www.pcgamingwiki.com/wiki/?curid=52107)
|
||||
* [Lone Pirate VR](https://www.pcgamingwiki.com/wiki/?curid=62951)
|
||||
* [Lone Survivor](https://www.pcgamingwiki.com/wiki/?curid=3011)
|
||||
* [Lone Vessel](https://www.pcgamingwiki.com/wiki/?curid=71723)
|
||||
* [Lone Warrior](https://www.pcgamingwiki.com/wiki/?curid=71621)
|
||||
* [Lone Wolf: Horizon](https://www.pcgamingwiki.com/wiki/?curid=44653)
|
||||
|
@ -27655,8 +27653,6 @@
|
|||
* [Pretty Girls Panic!](https://www.pcgamingwiki.com/wiki/?curid=55261)
|
||||
* [Prevent the Fall](https://www.pcgamingwiki.com/wiki/?curid=58469)
|
||||
* [Preventive Strike](https://www.pcgamingwiki.com/wiki/?curid=75149)
|
||||
* [Prey](https://www.pcgamingwiki.com/wiki/?curid=10517)
|
||||
* [Prey (2017)](https://www.pcgamingwiki.com/wiki/?curid=33371)
|
||||
* [Prey with Gun](https://www.pcgamingwiki.com/wiki/?curid=73532)
|
||||
* [Prey: Typhon Hunter](https://www.pcgamingwiki.com/wiki/?curid=124903)
|
||||
* [PRICE](https://www.pcgamingwiki.com/wiki/?curid=40042)
|
||||
|
|
|
@ -14,22 +14,23 @@ definitions:
|
|||
Os:
|
||||
type: string
|
||||
enum:
|
||||
- windows
|
||||
- linux
|
||||
- mac
|
||||
- windows
|
||||
Store:
|
||||
type: string
|
||||
enum:
|
||||
- steam
|
||||
- epic
|
||||
- discord
|
||||
- epic
|
||||
- gog
|
||||
- origin
|
||||
- steam
|
||||
- uplay
|
||||
Tag:
|
||||
type: string
|
||||
enum:
|
||||
- save
|
||||
- config
|
||||
- save
|
||||
|
||||
type: object
|
||||
additionalProperties:
|
||||
|
@ -63,5 +64,8 @@ additionalProperties:
|
|||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/RegistryConstraint"
|
||||
steamId:
|
||||
steam:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
|
|
|
@ -50,5 +50,8 @@ additionalProperties:
|
|||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/RegistryConstraint"
|
||||
steamId:
|
||||
steam:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
installDir: '1406'
|
||||
'1055140':
|
||||
installDir: 10-4
|
||||
'1058430':
|
||||
installDir: A Legionary's Life
|
||||
'1063230':
|
||||
installDir: '6120'
|
||||
'1063560':
|
||||
|
@ -68,6 +70,8 @@
|
|||
installDir: 123kickit
|
||||
'205690':
|
||||
installDir: 1000 Amps
|
||||
'209830':
|
||||
installDir: Lone Survivor
|
||||
'211670':
|
||||
installDir: 007 Legends
|
||||
'227580':
|
||||
|
@ -116,6 +120,8 @@
|
|||
installDir: 10 Minute Barbarian
|
||||
'396800':
|
||||
installDir: 12 Labours of Hercules IV Mother Nature
|
||||
'3970':
|
||||
installDir: Prey 2006
|
||||
'405180':
|
||||
installDir: 123 Slaughter Me Street
|
||||
'406730':
|
||||
|
@ -132,6 +138,8 @@
|
|||
installDir: 10 Second Ninja X
|
||||
'439550':
|
||||
installDir: '''n Verlore Verstand'
|
||||
'449250':
|
||||
installDir: A Little Lily Princess
|
||||
'449940':
|
||||
installDir: '! That Bastard Is Trying To Steal Our Gold !'
|
||||
'470060':
|
||||
|
@ -140,6 +148,8 @@
|
|||
installDir: .EXE
|
||||
'477010':
|
||||
installDir: 10 Minute Tower
|
||||
'480490':
|
||||
installDir: Prey
|
||||
'491330':
|
||||
installDir: 12 Labours of Hercules V Kids of Hellas
|
||||
'497400':
|
||||
|
@ -200,6 +210,8 @@
|
|||
installDir: projekt
|
||||
'761190':
|
||||
installDir: '1010'
|
||||
'766280':
|
||||
installDir: A Light in the Dark
|
||||
'771710':
|
||||
installDir: Test Expected Behaviour
|
||||
'791180':
|
||||
|
|
|
@ -36,13 +36,13 @@ $1 Ride:
|
|||
revId: 841129
|
||||
'''90s Football Stars':
|
||||
pageId: 98644
|
||||
revId: 841107
|
||||
revId: 975157
|
||||
'''n Verlore Verstand':
|
||||
pageId: 43728
|
||||
revId: 892716
|
||||
'***':
|
||||
pageId: 129579
|
||||
revId: 841120
|
||||
revId: 976962
|
||||
'-KLAUS-':
|
||||
pageId: 113092
|
||||
revId: 841110
|
||||
|
@ -69,7 +69,7 @@ $1 Ride:
|
|||
revId: 952124
|
||||
0 A.D.:
|
||||
pageId: 6203
|
||||
revId: 974024
|
||||
revId: 978749
|
||||
0 Day:
|
||||
pageId: 53391
|
||||
revId: 841116
|
||||
|
@ -93,7 +93,7 @@ $1 Ride:
|
|||
revId: 841123
|
||||
0°N 0°W:
|
||||
pageId: 67968
|
||||
revId: 841124
|
||||
revId: 978315
|
||||
1 Hit Kill:
|
||||
pageId: 103249
|
||||
revId: 841125
|
||||
|
@ -165,7 +165,7 @@ $1 Ride:
|
|||
revId: 839598
|
||||
100$:
|
||||
pageId: 127526
|
||||
revId: 910085
|
||||
revId: 976963
|
||||
100% Orange Juice!:
|
||||
pageId: 27256
|
||||
revId: 947097
|
||||
|
@ -363,7 +363,7 @@ $1 Ride:
|
|||
revId: 939407
|
||||
18+:
|
||||
pageId: 98580
|
||||
revId: 917659
|
||||
revId: 978068
|
||||
18+ MEMORY:
|
||||
pageId: 156473
|
||||
revId: 931643
|
||||
|
@ -1500,22 +1500,22 @@ A Legend of Luca:
|
|||
revId: 841528
|
||||
A Legionary's Life:
|
||||
pageId: 134830
|
||||
revId: null
|
||||
revId: 936654
|
||||
A Lenda do Herói:
|
||||
pageId: 38191
|
||||
revId: null
|
||||
revId: 977793
|
||||
A Light in the Dark:
|
||||
pageId: 87557
|
||||
revId: null
|
||||
revId: 841531
|
||||
A Little Lily Princess:
|
||||
pageId: 34700
|
||||
revId: null
|
||||
revId: 841532
|
||||
A Little Rabbit Story:
|
||||
pageId: 80968
|
||||
revId: null
|
||||
revId: 841533
|
||||
A Long Night For Crazy King:
|
||||
pageId: 150754
|
||||
revId: null
|
||||
revId: 902479
|
||||
A Long Road Home:
|
||||
pageId: 56912
|
||||
revId: null
|
||||
|
@ -63414,7 +63414,7 @@ Lone Pirate VR:
|
|||
revId: null
|
||||
Lone Survivor:
|
||||
pageId: 3011
|
||||
revId: null
|
||||
revId: 962604
|
||||
Lone Vessel:
|
||||
pageId: 71723
|
||||
revId: null
|
||||
|
@ -83139,10 +83139,11 @@ Preventive Strike:
|
|||
revId: null
|
||||
Prey:
|
||||
pageId: 10517
|
||||
revId: null
|
||||
revId: 973111
|
||||
Prey (2017):
|
||||
pageId: 33371
|
||||
revId: null
|
||||
revId: 978549
|
||||
unsupportedOs: true
|
||||
Prey with Gun:
|
||||
pageId: 73532
|
||||
revId: null
|
||||
|
|
|
@ -4,9 +4,9 @@ import * as pathMod from "path";
|
|||
import * as minimist from "minimist";
|
||||
import * as yaml from "js-yaml";
|
||||
import * as SteamUser from "steam-user";
|
||||
import { resolve } from "path";
|
||||
|
||||
const REPO = pathMod.dirname(__dirname);
|
||||
const DELAY_BETWEEN_GAMES_MS = 1000;
|
||||
|
||||
interface Cli {
|
||||
cache?: boolean,
|
||||
|
@ -14,6 +14,7 @@ interface Cli {
|
|||
all?: boolean,
|
||||
existing?: boolean,
|
||||
missing?: boolean,
|
||||
unchecked?: boolean,
|
||||
unsupportedOs?: boolean,
|
||||
unsupportedPath?: boolean,
|
||||
game?: string,
|
||||
|
@ -185,7 +186,9 @@ interface Game {
|
|||
tags?: Array<Tag>,
|
||||
}
|
||||
};
|
||||
steamId?: number;
|
||||
steam?: {
|
||||
id?: number
|
||||
};
|
||||
}
|
||||
|
||||
interface Constraint {
|
||||
|
@ -381,6 +384,7 @@ class ManifestFile extends YamlFile<Manifest> {
|
|||
all: boolean,
|
||||
existing: boolean,
|
||||
missing: boolean,
|
||||
unchecked: boolean,
|
||||
unsupportedOs: boolean,
|
||||
unsupportedPath: boolean,
|
||||
game: string | undefined,
|
||||
|
@ -400,6 +404,9 @@ class ManifestFile extends YamlFile<Manifest> {
|
|||
if (filter.missing && !this.data.hasOwnProperty(title)) {
|
||||
check = true;
|
||||
}
|
||||
if (filter.unchecked && wikiCache[title].revId === null) {
|
||||
check = true;
|
||||
}
|
||||
if (filter.unsupportedOs && info.unsupportedOs) {
|
||||
check = true;
|
||||
}
|
||||
|
@ -419,12 +426,12 @@ class ManifestFile extends YamlFile<Manifest> {
|
|||
}
|
||||
|
||||
const game = await getGame(title, wikiCache);
|
||||
if (game.files === undefined && game.registry === undefined && game.steamId === undefined) {
|
||||
if (game.files === undefined && game.registry === undefined && game.steam?.id === undefined) {
|
||||
delete this.data[title];
|
||||
continue;
|
||||
}
|
||||
if (game.steamId !== undefined) {
|
||||
const installDir = await steamCache.getAppInstallDir(game.steamId);
|
||||
if (game.steam?.id !== undefined) {
|
||||
const installDir = await steamCache.getAppInstallDir(game.steam.id);
|
||||
if (installDir !== undefined) {
|
||||
if (game.installDir === undefined) {
|
||||
game.installDir = {}
|
||||
|
@ -433,6 +440,8 @@ class ManifestFile extends YamlFile<Manifest> {
|
|||
}
|
||||
}
|
||||
this.data[title] = game;
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, DELAY_BETWEEN_GAMES_MS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -455,7 +464,7 @@ async function getGame(pageTitle: string, cache: WikiGameCache): Promise<Game> {
|
|||
if (template.name === "Infobox game") {
|
||||
const steamId = Number(template.parameters["steam appid"]);
|
||||
if (!isNaN(steamId) && steamId > 0) {
|
||||
game.steamId = steamId;
|
||||
game.steam = { id: steamId };
|
||||
}
|
||||
} else if (template.name === "Game data/saves" || template.name === "Game data/config") {
|
||||
const rawPath = typeof template.parameters[2] === "string" ? template.parameters[2] : template.parameters[2].toString();
|
||||
|
@ -465,13 +474,6 @@ async function getGame(pageTitle: string, cache: WikiGameCache): Promise<Game> {
|
|||
try {
|
||||
const [path, pathType] = parsePath(rawPath);
|
||||
if (pathType === PathType.FileSystem) {
|
||||
if (!game.files.hasOwnProperty(path)) {
|
||||
game.files[path] = {
|
||||
when: [],
|
||||
tags: [],
|
||||
};
|
||||
}
|
||||
|
||||
let os: Os | undefined = undefined;
|
||||
let store: Store | undefined = undefined;
|
||||
if ((template.parameters[1] as string).match(/steam/i)) {
|
||||
|
@ -480,6 +482,14 @@ async function getGame(pageTitle: string, cache: WikiGameCache): Promise<Game> {
|
|||
os = parseOs(template.parameters[1]);
|
||||
store = getStoreConstraintFromPath(rawPath);
|
||||
}
|
||||
|
||||
if (!game.files.hasOwnProperty(path)) {
|
||||
game.files[path] = {
|
||||
when: [],
|
||||
tags: [],
|
||||
};
|
||||
}
|
||||
|
||||
if (!game.files[path].when.some(x => x.os === os && x.store === store)) {
|
||||
if (os !== undefined && store !== undefined) {
|
||||
game.files[path].when.push({ os, store });
|
||||
|
@ -616,6 +626,7 @@ async function main() {
|
|||
all: args.all ?? false,
|
||||
existing: args.existing ?? false,
|
||||
missing: args.missing ?? false,
|
||||
unchecked: args.unchecked ?? false,
|
||||
unsupportedOs: args.unsupportedOs ?? false,
|
||||
unsupportedPath: args.unsupportedPath ?? false,
|
||||
game: args.game,
|
||||
|
|
Reference in a new issue