Fix irregular Steam entries thanks to steam-user library update
This commit is contained in:
parent
307fc3470c
commit
06265bff9d
4 changed files with 10994 additions and 306 deletions
4280
data/manifest.yaml
4280
data/manifest.yaml
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -12,6 +12,7 @@ interface Cli {
|
|||
stats?: boolean,
|
||||
duplicates?: boolean,
|
||||
all?: boolean,
|
||||
irregular?: boolean,
|
||||
irregularPathUntagged?: boolean,
|
||||
skipUntil?: string,
|
||||
recent?: boolean,
|
||||
|
@ -27,6 +28,7 @@ async function main() {
|
|||
"manifest",
|
||||
"stats",
|
||||
"all",
|
||||
"irregular",
|
||||
"irregularPathUntagged",
|
||||
"steam",
|
||||
"missing",
|
||||
|
@ -101,6 +103,7 @@ async function main() {
|
|||
if (args.steam) {
|
||||
await steamCache.refresh(
|
||||
args.skipUntil,
|
||||
args.irregular ?? false,
|
||||
args.irregularPathUntagged ?? false,
|
||||
args.limit ?? DEFAULT_GAME_LIMIT,
|
||||
);
|
||||
|
|
22
src/steam.ts
22
src/steam.ts
|
@ -62,12 +62,7 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
|
|||
|
||||
const installDir = info.apps[key].appinfo.config?.installdir;
|
||||
if (installDir !== undefined) {
|
||||
if (!this.isIrregularString(installDir)) {
|
||||
// Avoid: https://github.com/DoctorMcKay/node-steam-user/issues/397
|
||||
this.data[key].installDir = installDir;
|
||||
} else {
|
||||
this.data[key].irregular = true;
|
||||
}
|
||||
this.data[key].installDir = installDir;
|
||||
}
|
||||
|
||||
const nameLocalized = info.apps[key].appinfo.common?.name_localized;
|
||||
|
@ -79,18 +74,13 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
|
|||
if (launch !== undefined) {
|
||||
const keys = Object.keys(launch).sort((x, y) => parseInt(x) - parseInt(y));
|
||||
const launchArray = keys.map(x => launch[x]);
|
||||
if (launchArray.every(x => !this.hasIrregularKeys(x))) {
|
||||
// Avoid: https://github.com/DoctorMcKay/node-steam-user/issues/397
|
||||
this.data[key].launch = launchArray;
|
||||
} else {
|
||||
this.data[key].irregular = true;
|
||||
}
|
||||
this.data[key].launch = launchArray;
|
||||
}
|
||||
|
||||
return this.data[key];
|
||||
}
|
||||
|
||||
async refresh(skipUntil: string | undefined, irregularUntagged: boolean, limit: number): Promise<void> {
|
||||
async refresh(skipUntil: string | undefined, irregularTagged: boolean, irregularUntagged: boolean, limit: number): Promise<void> {
|
||||
let i = 0;
|
||||
let foundSkipUntil = false;
|
||||
for (const appId of Object.keys(this.data).sort()) {
|
||||
|
@ -102,6 +92,12 @@ export class SteamGameCacheFile extends YamlFile<SteamGameCache> {
|
|||
}
|
||||
}
|
||||
|
||||
if (irregularTagged) {
|
||||
if (!this.data[appId].irregular) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (irregularUntagged) {
|
||||
const irregular = (this.data[appId].launch ?? []).some(x => this.hasIrregularKeys(x)) ||
|
||||
this.isIrregularString(this.data[appId].installDir ?? "");
|
||||
|
|
Reference in a new issue