From 43951a200ded1aacf6c064e349d61f3cedaa293f Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 6 Dec 2025 12:57:51 +0100 Subject: [PATCH] Remove automatic cache scan on startup - Cache is now only refreshed when user presses 'r' - Empty cache on first launch - user must manually scan - More explicit control over library updates --- src/main.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index c70a05b..62f77fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,20 +31,12 @@ async fn main() -> Result<()> { tracing::info!("Loaded config from {:?}", config_path); - // Load cache - let mut cache = cache::Cache::load(&cache_dir) + // Load cache (empty if doesn't exist - user must press 'r' to scan) + let cache = cache::Cache::load(&cache_dir) .context("Failed to load cache")?; tracing::info!("Loaded cache from {:?}", cache_dir); - // If cache is empty and we have scan paths, perform initial scan - if cache.file_tree.is_empty() && !config.scan_paths.paths.is_empty() { - tracing::info!("Cache is empty, performing initial scan..."); - cache = scanner::scan_paths(&config.scan_paths.paths)?; - cache.save(&cache_dir)?; - tracing::info!("Initial scan complete, cache saved"); - } - // Initialize player let mut player = player::Player::new()?;