Normalize Steam Cloud paths more consistently

This commit is contained in:
mtkennerly 2024-04-20 22:45:12 -04:00
parent c087e48a1b
commit e10c8ac1e5
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
2 changed files with 7 additions and 12 deletions

View file

@ -251,11 +251,11 @@ impl Game {
}
fn add_file_constraint(&mut self, path: String, constraint: GameFileConstraint) {
self.files
.entry(path.replace('\\', "/"))
.or_default()
.when
.insert(constraint);
let path = path
.replace('\\', "/")
.replace("{64BitSteamID}", placeholder::STORE_USER_ID)
.replace("{Steam3AccountID}", placeholder::STORE_USER_ID);
self.files.entry(path).or_default().when.insert(constraint);
}
pub fn integrate_steam(&mut self, cache: &SteamCacheEntry) {
@ -383,11 +383,6 @@ impl Game {
path = path.replace(&transform.find, &transform.replace);
}
path = path
.replace('\\', "/")
.replace("{64BitSteamID}", placeholder::STORE_USER_ID)
.replace("{Steam3AccountID}", placeholder::STORE_USER_ID);
self.add_file_constraint(path, constraint.clone());
}
}

View file

@ -11,8 +11,8 @@ use crate::{
Error, State, REPO,
};
const SAVE_INTERVAL: u32 = 100;
const CHUNK_SIZE: usize = 10;
const SAVE_INTERVAL: u32 = 250;
const CHUNK_SIZE: usize = 25;
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
pub struct SteamCache(pub BTreeMap<u32, SteamCacheEntry>);