This commit is contained in:
2025-11-14 01:44:39 +01:00
parent f209653842
commit da8457edfc
2 changed files with 41 additions and 13 deletions
@@ -417,12 +417,12 @@ async fn refresh_games_list(app_handle: &AppHandle) {
let games_folder = games_folder_lock.read().await.clone();
if games_folder.is_empty() {
log::debug!("Games folder not set; skipping games list refresh");
return;
}
let path = PathBuf::from(&games_folder);
let path = if games_folder.is_empty() {
log::debug!("Games folder not set; emitting current game list without rescan");
None
} else {
Some(PathBuf::from(&games_folder))
};
let mut game_db = games_db_lock.write().await;
@@ -431,14 +431,18 @@ async fn refresh_games_list(app_handle: &AppHandle) {
return;
}
game_db.set_all_uninstalled();
if path.exists() {
for game in game_db.games.values_mut() {
update_game_installation_state(game, &path);
if let Some(ref path) = path {
if path.exists() {
game_db.set_all_uninstalled();
for game in game_db.games.values_mut() {
update_game_installation_state(game, path);
}
} else {
log::error!(
"game dir {} does not exist; keeping last known installation state",
path.display()
);
}
} else {
log::error!("game dir {} does not exist", path.display());
}
let games_to_emit = game_db