diff --git a/data/manifest.yaml b/data/manifest.yaml index 37013c2b..1727074d 100644 --- a/data/manifest.yaml +++ b/data/manifest.yaml @@ -37749,13 +37749,6 @@ Aspects of change: store: microsoft steam: id: 1815780 -Asphalt Xtreme: - files: - '{{p|programfiles}}/WindowsApps/A278AB0D.AsphaltXtreme_1.7.3.8_x86__h6adky7gbf63m': - tags: - - config - when: - - os: windows Asphyxia: installDir: Asphyxia: {} @@ -45825,12 +45818,22 @@ Back to the Egg!: - config when: - os: mac - /Telltale Games/Episode */*.save|/Telltale Games/Back to the Future 104/*.save: + /Telltale Games/Back to the Future 104/*.save: tags: - save when: - os: windows - /Telltale Games/Episode */prefs.prop|/Telltale Games/Back to the Future 104/prefs.prop: + /Telltale Games/Back to the Future 104/prefs.prop: + tags: + - config + when: + - os: windows + /Telltale Games/Episode */*.save: + tags: + - save + when: + - os: windows + /Telltale Games/Episode */prefs.prop: tags: - config when: @@ -86478,11 +86481,6 @@ Cats are Liquid: - save when: - os: windows - '{{p|HKEY_CURRENT_USER}}/SOFTWARE/LastQuarter Studios/Cats are Liquid': - tags: - - config - when: - - os: windows installDir: Cats are Liquid: {} launch: @@ -183422,14 +183420,6 @@ Farming Simulator 15: store: steam steam: id: 313160 -Farming Simulator 16: - files: - '{{p|programfiles}}/WindowsApps/GIANTSSoftware.FarmingSimulator16_1.1.2.8_x86__fa8jxm5fj0esw': - tags: - - save - when: - - os: windows - store: microsoft Farming Simulator 17: files: /My Games/FarmingSimulator2017: @@ -298052,11 +298042,6 @@ Lucadian Chronicles: - save when: - os: windows - '{{p|Linux}}~/.config/unity3d/melessthanthree/Lucah_ Born of a Dream': - tags: - - save - when: - - os: linux installDir: Lucah Born of a Dream: {} launch: @@ -316473,13 +316458,6 @@ MetalArms: MetalArms: {} steam: id: 1155860 -'Metalheart: Replicants Rampage': - files: - '{{p|ProgramFiles}}/NumLock/Metalheart/data/save': - tags: - - save - when: - - os: windows 'Metaloid : Origin': installDir: Morigin: {} @@ -372775,13 +372753,6 @@ Phantasy Star Online 2 New Genesis: store: steam steam: id: 1056640 -Phantasy Star Universe: - files: - '{{p|}}/SEGA/PHANTASY STAR UNIVERSE/Psu.ini': - tags: - - config - when: - - os: windows Phantom: installDir: Phantom: {} @@ -410592,7 +410563,13 @@ Retro/Grade: id: 222660 RetroArch: files: - /configs/*/*.opt|/configs/*/*.cfg: + /configs/*/*.cfg: + tags: + - config + when: + - os: windows + - os: mac + /configs/*/*.opt: tags: - config when: @@ -428806,12 +428783,22 @@ Sam & Max Hit the Road: id: 355170 Sam & Max Save the World: files: - /*/*.save|/Telltale Games/*/*.save: + /*/*.save: tags: - save when: - os: windows - /*/prefs.prop|/Telltale Games/*/prefs.prop: + /*/prefs.prop: + tags: + - config + when: + - os: windows + /Telltale Games/*/*.save: + tags: + - save + when: + - os: windows + /Telltale Games/*/prefs.prop: tags: - config when: @@ -577384,12 +577371,22 @@ Wall to Wall: id: 1027080 Wallace & Gromit's Grand Adventures: files: - /Telltale Games/Wallace and Gromit Ep*/*.save|/Telltale Games/Wallace & Gromit - */*.save: + /Telltale Games/Wallace & Gromit - */*.save: tags: - save when: - os: windows - /Telltale Games/Wallace and Gromit Ep*/prefs.prop|/Telltale Games/Wallace & Gromit - */prefs.prop: + /Telltale Games/Wallace & Gromit - */prefs.prop: + tags: + - config + when: + - os: windows + /Telltale Games/Wallace and Gromit Ep*/*.save: + tags: + - save + when: + - os: windows + /Telltale Games/Wallace and Gromit Ep*/prefs.prop: tags: - config when: diff --git a/data/missing.md b/data/missing.md index 2a7e31b3..9b1ba27c 100644 --- a/data/missing.md +++ b/data/missing.md @@ -2244,6 +2244,7 @@ * [Asphalt 7: Heat](https://www.pcgamingwiki.com/wiki/?curid=24947) * [Asphalt Overdrive](https://www.pcgamingwiki.com/wiki/?curid=171874) * [Asphalt Street Storm Racing](https://www.pcgamingwiki.com/wiki/?curid=171872) +* [Asphalt Xtreme](https://www.pcgamingwiki.com/wiki/?curid=57248) * [Asphyxia](https://www.pcgamingwiki.com/wiki/?curid=33642) * [Aspire: Ina's Tale](https://www.pcgamingwiki.com/wiki/?curid=173772) * [ASRECorp](https://www.pcgamingwiki.com/wiki/?curid=42155) @@ -11098,6 +11099,7 @@ * [Farming 6-in-1 bundle](https://www.pcgamingwiki.com/wiki/?curid=42746) * [Farming Giant](https://www.pcgamingwiki.com/wiki/?curid=40524) * [Farming Life](https://www.pcgamingwiki.com/wiki/?curid=128371) +* [Farming Simulator 16](https://www.pcgamingwiki.com/wiki/?curid=168192) * [Farming Village](https://www.pcgamingwiki.com/wiki/?curid=144059) * [Farming World](https://www.pcgamingwiki.com/wiki/?curid=50324) * [Farmington County](https://www.pcgamingwiki.com/wiki/?curid=148886) @@ -19468,6 +19470,7 @@ * [Metal: Iron Age](https://www.pcgamingwiki.com/wiki/?curid=90252) * [MetalArms](https://www.pcgamingwiki.com/wiki/?curid=149503) * [MetälBörn](https://www.pcgamingwiki.com/wiki/?curid=180121) +* [Metalheart: Replicants Rampage](https://www.pcgamingwiki.com/wiki/?curid=35279) * [Metaloid : Origin](https://www.pcgamingwiki.com/wiki/?curid=126010) * [Metamorph (Chumoran)](https://www.pcgamingwiki.com/wiki/?curid=121083) * [Metamorphabet](https://www.pcgamingwiki.com/wiki/?curid=48062) @@ -22904,6 +22907,7 @@ * [Phantasmat: The Dread of Oakville](https://www.pcgamingwiki.com/wiki/?curid=112812) * [Phantasmat: The Endless Night](https://www.pcgamingwiki.com/wiki/?curid=62239) * [Phantasmata](https://www.pcgamingwiki.com/wiki/?curid=132901) +* [Phantasy Star Universe](https://www.pcgamingwiki.com/wiki/?curid=17795) * [Phantasy Star Universe: Ambition of the Illuminus](https://www.pcgamingwiki.com/wiki/?curid=169291) * [Phantom](https://www.pcgamingwiki.com/wiki/?curid=59661) * [Phantom Astronaut Lucid VR](https://www.pcgamingwiki.com/wiki/?curid=149344) diff --git a/src/wiki.ts b/src/wiki.ts index 4f913afc..0f0154c2 100644 --- a/src/wiki.ts +++ b/src/wiki.ts @@ -293,6 +293,14 @@ function makePathArgRegex(arg: string): RegExp { return new RegExp(escaped, "gi"); } +function normalizePath(path: string): string { + return path + .replace(/\\/g, "/") + .replace(/\/{2,}/g, "/") + .replace(/\/(?=$)/g, "") + .replace(/^~(?=($|\/))/, ""); +} + /** * https://www.pcgamingwiki.com/wiki/Template:Path */ @@ -315,11 +323,7 @@ function parsePath(path: string): [string, PathType] { } } - path = path - .replace(/\\/g, "/") - .replace(/\/{2,}/g, "/") - .replace(/\/(?=$)/g, "") - .replace(/^~(?=($|\/))/, "") + path = normalizePath(path) .replace(/%userprofile%\/AppData\/Roaming/i, "") .replace(/%userprofile%\/AppData\/Local(?!Low)/i, "") .replace(/%userprofile%\/Documents/i, "") @@ -691,51 +695,56 @@ export function parseTemplates(templates: Array): Pick x.os === constraint.os && x.store === constraint.store)) { - if (constraint.os !== undefined && constraint.store !== undefined) { - game.files[path].when.push(constraint); - } else if (constraint.os !== undefined) { - game.files[path].when.push({ os: constraint.os }); - } else if (constraint.store !== undefined) { - game.files[path].when.push({ store: constraint.store }); + if (pathType === PathType.FileSystem) { + const constraint = getConstraintFromSystem(system, rawPath); + + if (!game.files.hasOwnProperty(path)) { + game.files[path] = { + when: [], + tags: [], + }; } - } - const tag = getTagFromTemplate(template.name); - if (tag !== undefined && !game.files[path].tags.includes(tag)) { - game.files[path].tags.push(tag); - } - } else if (pathType === PathType.Registry) { - if (!game.registry.hasOwnProperty(path)) { - game.registry[path] = { - when: [], - tags: [], - }; - } + if (!game.files[path].when.some(x => x.os === constraint.os && x.store === constraint.store)) { + if (constraint.os !== undefined && constraint.store !== undefined) { + game.files[path].when.push(constraint); + } else if (constraint.os !== undefined) { + game.files[path].when.push({ os: constraint.os }); + } else if (constraint.store !== undefined) { + game.files[path].when.push({ store: constraint.store }); + } + } - const store = getStoreConstraintFromPath(rawPath); - if (store !== undefined && !game.registry[path].when.some(x => x.store === store)) { - game.registry[path].when.push({ store }); - } + const tag = getTagFromTemplate(template.name); + if (tag !== undefined && !game.files[path].tags.includes(tag)) { + game.files[path].tags.push(tag); + } + } else if (pathType === PathType.Registry) { + if (!game.registry.hasOwnProperty(path)) { + game.registry[path] = { + when: [], + tags: [], + }; + } - const tag = getTagFromTemplate(template.name); - if (tag !== undefined && !game.registry[path].tags.includes(tag)) { - game.registry[path].tags.push(tag); + const store = getStoreConstraintFromPath(rawPath); + if (store !== undefined && !game.registry[path].when.some(x => x.store === store)) { + game.registry[path].when.push({ store }); + } + + const tag = getTagFromTemplate(template.name); + if (tag !== undefined && !game.registry[path].tags.includes(tag)) { + game.registry[path].tags.push(tag); + } } } }