diff --git a/client/src/archive.rs b/client/src/archive.rs index 147119b..b2c30b0 100644 --- a/client/src/archive.rs +++ b/client/src/archive.rs @@ -132,7 +132,7 @@ impl Archive { // FIXME: There most likely is a function that does this (check clippy) let friendly_name = friendly_name.map(|s| s.to_owned()); - Ok(GameSaveLocation::new(game_files, friendly_name)) + Ok(GameSaveLocation::new(path, game_files, friendly_name)) } /// Removes a game from the list of traked games diff --git a/src/game.rs b/src/game.rs index 7f47da2..598fb6b 100644 --- a/src/game.rs +++ b/src/game.rs @@ -12,14 +12,19 @@ const XXHASH64_SEED: u64 = 1337; #[derive(Debug, Clone)] pub struct GameSaveLocation { pub friendly_name: Option, + pub original_path: PathBuf, files: Vec, uuid: Uuid, } impl GameSaveLocation { - pub fn new(files: Vec, friendly_name: Option) -> Self { + pub fn new

(path: P, files: Vec, friendly_name: Option) -> Self + where + P: AsRef, + { Self { friendly_name, + original_path: path.as_ref().to_path_buf(), files, uuid: Uuid::new_v4(), }