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:
parent
125bc24ed0
commit
a0357b3ee3
|
@ -8,7 +8,6 @@ use walkdir::WalkDir;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Archive {
|
pub struct Archive {
|
||||||
tracked_games: Vec<GameSaveLocation>,
|
|
||||||
data_root: PathBuf,
|
data_root: PathBuf,
|
||||||
config_root: PathBuf,
|
config_root: PathBuf,
|
||||||
}
|
}
|
||||||
|
@ -32,7 +31,6 @@ impl Archive {
|
||||||
debug!("Created default Archive with: {:?} and {:?}", data, config);
|
debug!("Created default Archive with: {:?} and {:?}", data, config);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
tracked_games: Vec::new(),
|
|
||||||
data_root: data,
|
data_root: data,
|
||||||
config_root: config,
|
config_root: config,
|
||||||
})
|
})
|
||||||
|
@ -59,7 +57,6 @@ impl Archive {
|
||||||
);
|
);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
tracked_games: Vec::new(),
|
|
||||||
data_root: data_root.to_path_buf(),
|
data_root: data_root.to_path_buf(),
|
||||||
config_root: config_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> {
|
pub fn track_game<P: AsRef<Path>>(&mut self, path: P) -> Result<(), GameTrackError> {
|
||||||
let game_save_loc = self.get_game_save_files(path, None)?;
|
let game_save_loc = self.get_game_save_files(path, None)?;
|
||||||
|
Self::write_game_save(&game_save_loc)?;
|
||||||
Self::write_game_save(&game_save_loc);
|
|
||||||
|
|
||||||
self.tracked_games.push(game_save_loc);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,10 +109,7 @@ impl Archive {
|
||||||
P: AsRef<Path>,
|
P: AsRef<Path>,
|
||||||
{
|
{
|
||||||
let game_save_loc = self.get_game_save_files(path, Some(name))?;
|
let game_save_loc = self.get_game_save_files(path, Some(name))?;
|
||||||
|
Self::write_game_save(&game_save_loc)?;
|
||||||
Self::write_game_save(&game_save_loc);
|
|
||||||
|
|
||||||
self.tracked_games.push(game_save_loc);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue