Add launch section to manifest
This commit is contained in:
parent
cb242f6433
commit
a046c18ad4
7 changed files with 266804 additions and 373 deletions
22
src/steam.ts
22
src/steam.ts
|
@ -1,12 +1,23 @@
|
|||
import { DELAY_BETWEEN_GAMES_MS, REPO, YamlFile } from ".";
|
||||
import * as SteamUser from "steam-user";
|
||||
|
||||
type SteamGameCache = {
|
||||
export type SteamGameCache = {
|
||||
[appId: string]: {
|
||||
installDir?: string,
|
||||
unknown?: boolean,
|
||||
nameLocalized?: Map<string, string>;
|
||||
launch?: Array<object>;
|
||||
launch?: Array<{
|
||||
executable?: string;
|
||||
arguments?: string;
|
||||
workingdir?: string;
|
||||
type?: string;
|
||||
config?: {
|
||||
betakey?: string;
|
||||
osarch?: string;
|
||||
oslist?: string;
|
||||
ownsdlc?: string;
|
||||
},
|
||||
}>;
|
||||
irregular?: boolean;
|
||||
};
|
||||
};
|
||||
|
@ -14,8 +25,9 @@ type SteamGameCache = {
|
|||
export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
|
||||
path = `${REPO}/data/steam-game-cache.yaml`;
|
||||
defaultData = {};
|
||||
steamClient: SteamUser | null = null;
|
||||
|
||||
constructor(public steamClient: SteamUser) {
|
||||
constructor(private makeSteamClient: () => Promise<SteamUser>) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -33,6 +45,10 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
|
|||
return this.data[key];
|
||||
}
|
||||
|
||||
if (this.steamClient === null) {
|
||||
this.steamClient = await this.makeSteamClient();
|
||||
}
|
||||
|
||||
const info: SteamProductInfoResponse = await this.steamClient.getProductInfo([appId], []);
|
||||
|
||||
if (info.unknownApps.includes(appId)) {
|
||||
|
|
Reference in a new issue