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:
Rekai Nyangadzayi Musuka 2021-03-02 20:32:24 -06:00
parent 125bc24ed0
commit a0357b3ee3
1 changed files with 2 additions and 11 deletions

View File

@ -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(())
}