Mark some more paths as too broad

This commit is contained in:
mtkennerly 2024-04-21 19:49:20 -04:00
parent 7589448030
commit d132d15c21
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
4 changed files with 22 additions and 39 deletions

View file

@ -19640,11 +19640,6 @@ After the End:
tags:
- config
"After the End: The Harvest":
files:
"<base>/C:/Program Files (x86)/Steam/steamapps/common/After The End The Harvest/**/*.rvdata2":
when:
- os: windows
store: steam
installDir:
After The End The Harvest: {}
launch:
@ -71018,10 +71013,6 @@ Biorhythm:
steam:
id: 1033340
Bios Ex - Yami no Wakusei:
files:
"<base>/D:/Games ISO/GamePC/Steam/SteamApps/common/Bios Ex/game/saves/*.save":
when:
- store: steam
installDir:
Bios Ex: {}
launch:
@ -90723,22 +90714,10 @@ Bud Spencer & Terence Hill - Slaps and Beans:
id: 564050
"Bud Spencer & Terence Hill: Slaps and Beans 2":
files:
"<home>/AppData/LocalLow/TrinityTeam/SnB2/**/*:*":
when:
- os: windows
store: steam
"<home>/Library/Application Support/TrinityTeam/SnB2/**/**":
when:
- os: mac
store: steam
"<xdgConfig>/unity3d/**/*.*":
when:
- os: linux
store: steam
"<xdgData>/unity3d/**/*.*":
when:
- os: linux
store: steam
installDir:
Bud Spencer & Terence Hill - Slaps And Beans 2: {}
launch:
@ -254799,10 +254778,6 @@ Ginga Kagekidan - 放課後くるーずっ!:
"<home>/AppData/LocalLow/Drakhar Studio/Ginger_ Beyond the Crystal/*.prefs":
when:
- store: steam
"<home>/Library/Application Support/unity.Drakhar Studio.Ginger: Beyond the Crystal/*.prefs":
when:
- os: mac
store: steam
installDir:
Ginger Beyond the Crystal: {}
launch:
@ -348016,10 +347991,6 @@ Liberté:
"<home>/AppData/LocalLow/Superstatic/Liberte/Save":
when:
- store: steam
"<xdgData>/deck/.local/share/Steam/steamapps/compatdata/1590160/pfx/dosdevices/c:/users/steamuser/AppData/LocalLow/Superstatic/Liberte/Save":
when:
- os: linux
store: steam
gog:
id: 1355106030
installDir:

View file

@ -772,6 +772,7 @@
* [After Rain: Phoenix Rise](https://www.pcgamingwiki.com/wiki/?curid=69749)
* [After Reset RPG](https://www.pcgamingwiki.com/wiki/?curid=48497)
* [After the Empire](https://www.pcgamingwiki.com/wiki/?curid=60227)
* [After the End: The Harvest](https://www.pcgamingwiki.com/wiki/?curid=47297)
* [After the Fall](https://www.pcgamingwiki.com/wiki/?curid=140514)
* [After the Inferno](https://www.pcgamingwiki.com/wiki/?curid=180244)
* [After The Suns](https://www.pcgamingwiki.com/wiki/?curid=139035)
@ -2881,6 +2882,7 @@
* [Bionic Hunter VR](https://www.pcgamingwiki.com/wiki/?curid=153786)
* [BionicBlitz](https://www.pcgamingwiki.com/wiki/?curid=128134)
* [Bionite: Origins](https://www.pcgamingwiki.com/wiki/?curid=45146)
* [Bios Ex - Yami no Wakusei](https://www.pcgamingwiki.com/wiki/?curid=128708)
* [Biosupremacy](https://www.pcgamingwiki.com/wiki/?curid=58914)
* [BIOSZARD Corporation](https://www.pcgamingwiki.com/wiki/?curid=130297)
* [Biotix: Phage Genesis](https://www.pcgamingwiki.com/wiki/?curid=91126)

View file

@ -270,7 +270,7 @@ impl Game {
fn add_file_constraint(&mut self, path: String, constraint: GameFileConstraint) {
let path = path::normalize(&path);
if path::usable(&path) {
if path::usable(&path) && !path.contains(':') {
self.files.entry(path).or_default().when.insert(constraint);
}
}

View file

@ -47,17 +47,17 @@ pub fn normalize(path: &str) -> String {
}
pub fn too_broad(path: &str) -> bool {
use placeholder::{BASE, HOME, ROOT, STORE_USER_ID, WIN_DIR, WIN_DOCUMENTS};
use placeholder::{BASE, HOME, ROOT, STORE_USER_ID, WIN_DIR, WIN_DOCUMENTS, XDG_CONFIG, XDG_DATA};
for placeholder in placeholder::ALL {
if path == *placeholder {
for item in placeholder::ALL {
if path == *item {
return true;
}
}
// These paths are present whether or not the game is installed.
// If possible, they should be narrowed down on the wiki.
let broad = vec![
for item in [
format!("{BASE}/{STORE_USER_ID}"), // because `<storeUserId>` is handled as `*`
format!("{HOME}/Documents"),
format!("{HOME}/Saved Games"),
@ -75,16 +75,26 @@ pub fn too_broad(path: &str) -> bool {
format!("{WIN_DIR}/SysWOW64"),
format!("{WIN_DOCUMENTS}/My Games"),
format!("{WIN_DOCUMENTS}/Telltale Games"),
format!("{XDG_CONFIG}/unity3d"),
format!("{XDG_DATA}/unity3d"),
"C:/Program Files".to_string(),
];
if broad.iter().any(|x| *x == path) {
"C:/Program Files (x86)".to_string(),
] {
if path == item {
return true;
}
}
// Several games/episodes are grouped together here.
if path.starts_with(&format!("{WIN_DOCUMENTS}/Telltale Games/*/")) {
for item in [
format!("{WIN_DOCUMENTS}/Telltale Games/*/"),
format!("{XDG_CONFIG}/unity3d/*"),
format!("{XDG_DATA}/unity3d/*"),
] {
if path.starts_with(&item) {
return true;
}
}
// Drive letters:
static DRIVES: Lazy<Regex> = Lazy::new(|| Regex::new(r"^[a-zA-Z]:$").unwrap());