Fix critical Windows compatibility issues and implement file batching

- Fix critical HOME variable bug that crashed on Windows
  * Replace hardcoded HOME env var with Config::get_data_dir()
  * Now uses cross-platform directories crate
  * Resolves to %APPDATA% on Windows, ~/.config on Linux/macOS

- Fix Unix-style path separators in display output
  * Use std::path::MAIN_SEPARATOR for OS-appropriate paths
  * Windows now shows backslashes, Unix shows forward slashes

- Implement batching for large file lists (100+ files)
  * Split file processing into batches of 50 files
  * Prevents network timeouts and API payload size issues
  * Added progress feedback for batch processing
  * Increased timeout from 30s to 120s per batch

- Bump version to 1.0.3

All tests passing, clippy clean, fully cross-platform compatible
This commit is contained in:
glitchySid
2025-12-30 19:43:19 +05:30
parent 9843303d9a
commit 282e032086
4 changed files with 25 additions and 12 deletions

View File

@@ -96,11 +96,9 @@ pub async fn handle_organization(
) -> Result<(), Box<dyn std::error::Error>> {
let client: GeminiClient = GeminiClient::new(api_key);
let mut cache_path = std::env::var("HOME")
.map(PathBuf::from)
.expect("No Home found");
cache_path.push(".config/noentropy/data/.noentropy_cache.json");
let mut cache = Cache::load_or_create(cache_path.as_path());
let data_dir = Config::get_data_dir()?;
let cache_path = data_dir.join(".noentropy_cache.json");
let mut cache = Cache::load_or_create(&cache_path);
cache.cleanup_old_entries(7 * 24 * 60 * 60);