use std::fs;
use std::path::Path;
use crate::data::models::StatsCache;
pub fn parse_stats_cache(path: &Path) -> Result<StatsCache, String> {
let content = fs::read_to_string(path)
.map_err(|e| format!("Failed to read stats-cache.json: {}", e))?;
serde_json::from_str(&content)
.map_err(|e| format!("Failed to parse stats-cache.json: {}", e))
}