Show refreshing status during library scan

- Add is_refreshing flag to AppState
- Display 'Refreshing library...' in status panel during scan
- Note: scan is currently blocking, message may be brief
- Infrastructure ready for future async scanning
This commit is contained in:
2025-12-06 13:04:00 +01:00
parent afc58a7920
commit 71b43d644c
3 changed files with 13 additions and 5 deletions

View File

@@ -178,12 +178,14 @@ async fn handle_key_event(state: &mut AppState, player: &mut player::Player, key
}
}
KeyCode::Char('r') => {
state.is_refreshing = true;
tracing::info!("Rescanning...");
let cache_dir = cache::get_cache_dir()?;
let new_cache = scanner::scan_paths(&state.config.scan_paths.paths)?;
new_cache.save(&cache_dir)?;
state.cache = new_cache;
state.refresh_flattened_items();
state.is_refreshing = false;
tracing::info!("Rescan complete");
}
_ => {}