Ignore case for filtering and map another Steam Cloud root

This commit is contained in:
mtkennerly 2024-04-22 13:57:13 -04:00
parent 58270b6136
commit 4461deecfe
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
4 changed files with 13 additions and 13 deletions

View file

@ -627219,10 +627219,6 @@ The Legend of Crystal Valley:
"<base>/userData": "<base>/userData":
when: when:
- store: steam - store: steam
"<home>/Library/Application Support/userData":
when:
- os: mac
store: steam
installDir: installDir:
The Legend of Crystal Valley: {} The Legend of Crystal Valley: {}
launch: launch:
@ -631226,6 +631222,10 @@ The Missing Few:
steam: steam:
id: 842910 id: 842910
The Mobius Machine: The Mobius Machine:
files:
"<home>/Documents/The Mobius Machine/Saves":
when:
- store: steam
installDir: installDir:
The Mobius Machine: {} The Mobius Machine: {}
launch: launch:
@ -641284,10 +641284,6 @@ The Technician:
when: when:
- os: windows - os: windows
store: steam store: steam
"<home>/Library/Application Support/UserData/<storeUserId>/**/*.json":
when:
- os: mac
store: steam
installDir: installDir:
The Technician: {} The Technician: {}
steam: steam:

View file

@ -26011,7 +26011,6 @@
* [The Misfits](https://www.pcgamingwiki.com/wiki/?curid=104797) * [The Misfits](https://www.pcgamingwiki.com/wiki/?curid=104797)
* [The Miskatonic](https://www.pcgamingwiki.com/wiki/?curid=100230) * [The Miskatonic](https://www.pcgamingwiki.com/wiki/?curid=100230)
* [The Missing Few](https://www.pcgamingwiki.com/wiki/?curid=157259) * [The Missing Few](https://www.pcgamingwiki.com/wiki/?curid=157259)
* [The Mobius Machine](https://www.pcgamingwiki.com/wiki/?curid=189831)
* [The Momo Game](https://www.pcgamingwiki.com/wiki/?curid=121537) * [The Momo Game](https://www.pcgamingwiki.com/wiki/?curid=121537)
* [The Monster](https://www.pcgamingwiki.com/wiki/?curid=121300) * [The Monster](https://www.pcgamingwiki.com/wiki/?curid=121300)
* [The Monster Breeder](https://www.pcgamingwiki.com/wiki/?curid=154367) * [The Monster Breeder](https://www.pcgamingwiki.com/wiki/?curid=154367)

View file

@ -55,6 +55,8 @@ pub fn normalize(path: &str) -> String {
fn too_broad(path: &str) -> bool { fn too_broad(path: &str) -> bool {
use placeholder::{BASE, HOME, ROOT, STORE_USER_ID, WIN_APP_DATA, WIN_DIR, WIN_DOCUMENTS, XDG_CONFIG, XDG_DATA}; use placeholder::{BASE, HOME, ROOT, STORE_USER_ID, WIN_APP_DATA, WIN_DIR, WIN_DOCUMENTS, XDG_CONFIG, XDG_DATA};
let path_lower = path.to_lowercase();
for item in placeholder::ALL { for item in placeholder::ALL {
if path == *item { if path == *item {
return true; return true;
@ -80,6 +82,7 @@ fn too_broad(path: &str) -> bool {
format!("{HOME}/AppData/Roaming"), format!("{HOME}/AppData/Roaming"),
format!("{HOME}/Documents/My Games"), format!("{HOME}/Documents/My Games"),
format!("{HOME}/Library/Application Support"), format!("{HOME}/Library/Application Support"),
format!("{HOME}/Library/Application Support/UserData"),
format!("{HOME}/Library/Preferences"), format!("{HOME}/Library/Preferences"),
format!("{HOME}/.renpy"), format!("{HOME}/.renpy"),
format!("{HOME}/Library/RenPy"), format!("{HOME}/Library/RenPy"),
@ -95,10 +98,11 @@ fn too_broad(path: &str) -> bool {
"C:/Program Files".to_string(), "C:/Program Files".to_string(),
"C:/Program Files (x86)".to_string(), "C:/Program Files (x86)".to_string(),
] { ] {
if path == item let item = item.to_lowercase();
|| path.starts_with(&format!("{item}/*")) if path_lower == item
|| path.starts_with(&format!("{item}/{STORE_USER_ID}")) || path_lower.starts_with(&format!("{item}/*"))
|| path.starts_with(&format!("{item}/SavesDir")) || path_lower.starts_with(&format!("{item}/{}", STORE_USER_ID.to_lowercase()))
|| path_lower.starts_with(&format!("{item}/savesdir"))
{ {
return true; return true;
} }

View file

@ -517,6 +517,7 @@ pub fn parse_root(value: &str) -> Option<&'static str> {
"winappdataroaming" => Some(placeholder::WIN_APP_DATA), "winappdataroaming" => Some(placeholder::WIN_APP_DATA),
"winappdatalocal" => Some(placeholder::WIN_LOCAL_APP_DATA), "winappdatalocal" => Some(placeholder::WIN_LOCAL_APP_DATA),
"winappdatalocallow" => Some("<home>/AppData/LocalLow"), "winappdatalocallow" => Some("<home>/AppData/LocalLow"),
"windowshome" => Some(placeholder::HOME),
"winmydocuments" => Some(placeholder::WIN_DOCUMENTS), "winmydocuments" => Some(placeholder::WIN_DOCUMENTS),
"winsavedgames" => Some("<home>/Saved Games"), "winsavedgames" => Some("<home>/Saved Games"),
_ => { _ => {