fix(client): Remove tracked_files property
Maybe there might be value in looking to caching values from the database, but as of right now it's complexity that doesn't really makes sense since the program never lives long enough for us to ever use the cache.
This commit is contained in:
@@ -8,7 +8,6 @@ use walkdir::WalkDir;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Archive {
|
||||
tracked_games: Vec<GameSaveLocation>,
|
||||
data_root: PathBuf,
|
||||
config_root: PathBuf,
|
||||
}
|
||||
@@ -32,7 +31,6 @@ impl Archive {
|
||||
debug!("Created default Archive with: {:?} and {:?}", data, config);
|
||||
|
||||
Ok(Self {
|
||||
tracked_games: Vec::new(),
|
||||
data_root: data,
|
||||
config_root: config,
|
||||
})
|
||||
@@ -59,7 +57,6 @@ impl Archive {
|
||||
);
|
||||
|
||||
Self {
|
||||
tracked_games: Vec::new(),
|
||||
data_root: data_root.to_path_buf(),
|
||||
config_root: config_root.to_path_buf(),
|
||||
}
|
||||
@@ -86,10 +83,7 @@ impl Archive {
|
||||
/// ```
|
||||
pub fn track_game<P: AsRef<Path>>(&mut self, path: P) -> Result<(), GameTrackError> {
|
||||
let game_save_loc = self.get_game_save_files(path, None)?;
|
||||
|
||||
Self::write_game_save(&game_save_loc);
|
||||
|
||||
self.tracked_games.push(game_save_loc);
|
||||
Self::write_game_save(&game_save_loc)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -115,10 +109,7 @@ impl Archive {
|
||||
P: AsRef<Path>,
|
||||
{
|
||||
let game_save_loc = self.get_game_save_files(path, Some(name))?;
|
||||
|
||||
Self::write_game_save(&game_save_loc);
|
||||
|
||||
self.tracked_games.push(game_save_loc);
|
||||
Self::write_game_save(&game_save_loc)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user