{"record":{"id":"bd2e0af787b822bc","repo":"tonhowtf/omniget","slug":"n-o-achei-nenhum-streaminghistory-json-streaming-history","errorCode":null,"errorMessage":"não achei nenhum StreamingHistory_*.json / Streaming_History_Audio_*.json","messagePattern":"não achei nenhum StreamingHistory_\\*\\.json / Streaming_History_Audio_\\*\\.json","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/music/history.rs","lineNumber":750,"sourceCode":"                    r.exports.push(p.to_string_lossy().to_string());\n                }\n            }\n            \"md\" => {\n                let p = out_dir.join(\"historico-spotify.md\");\n                std::fs::write(&p, report_markdown(r))?;\n                r.exports.push(p.to_string_lossy().to_string());\n            }\n            _ => {}\n        }\n    }\n    Ok(())\n}\n\npub fn run(opts: &HistoryOptions, p: &ProgressFn) -> Result<HistoryResult> {\n    report(p, TOOL_ID, \"started\", 0, None, None);\n    let sources = collect_sources(&opts.inputs)?;\n    if sources.is_empty() {\n        anyhow::bail!(\"não achei nenhum StreamingHistory_*.json / Streaming_History_Audio_*.json\");\n    }\n    let total = sources.len() as u64;\n    let mut plays = Vec::new();\n    let mut files = Vec::new();\n    for (i, (name, text)) in sources.iter().enumerate() {\n        report(\n            p,\n            TOOL_ID,\n            \"progress\",\n            i as u64 + 1,\n            Some(total),\n            Some(name.clone()),\n        );\n        let mut got = parse_history(text, opts.min_ms);\n        if !got.is_empty() {\n            files.push(name.clone());\n            plays.append(&mut got);\n        }","sourceCodeStart":732,"sourceCodeEnd":768,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/music/history.rs#L732-L768","documentation":"Thrown by music history's `run` when `collect_sources` over the given inputs finds zero files matching `StreamingHistory_*.json` or `Streaming_History_Audio_*.json`. Spotify's history export must contain at least one of these files for the analysis to proceed.","triggerScenarios":"Calling `run(&HistoryOptions { inputs: [paths..] }, ..)` where none of the input paths/directories contain files matching either glob pattern.","commonSituations":"User unzipped the Spotify export but points the tool at the wrong folder; renamed the JSON files; Spotify changed export filenames between years (StreamingHistory vs Streaming_History_Audio); passing the zip itself instead of extracted files.","solutions":["Point `inputs` at the extracted Spotify data export directory containing the history JSONs","Check filenames match the patterns exactly (rename if needed)","Extract the export zip first — the tool won't read archives","Confirm the export actually includes streaming history (some exports omit it)"],"exampleFix":"// before\nHistoryOptions { inputs: vec![\"~/Downloads/mydata.zip\".into()] }\n// after\nHistoryOptions { inputs: vec![\"~/Downloads/mydata/\".into()] } // extracted dir with Streaming_History_Audio_*.json","handlingStrategy":"validation","validationCode":"let has_history = std::fs::read_dir(input_dir)?\n    .filter_map(|e| e.ok())\n    .any(|e| {\n        let n = e.file_name().to_string_lossy().into_owned();\n        n.starts_with(\"StreamingHistory_\") || n.starts_with(\"Streaming_History_Audio_\")\n    }) && std::path::Path::new(input_dir).is_dir();\nif !has_history {\n    return Err(\"folder contains no Spotify streaming history JSON files\".into());\n}","typeGuard":"fn contains_history_files(dir: &str) -> bool {\n    std::fs::read_dir(dir).map(|rd| rd.filter_map(|e| e.ok()).any(|e| {\n        let n = e.file_name().to_string_lossy();\n        n.starts_with(\"StreamingHistory_\") || n.starts_with(\"Streaming_History_Audio_\")\n    })).unwrap_or(false)\n}","tryCatchPattern":"match history::run(&opts, &progress) {\n    Ok(result) => show(result),\n    Err(e) if e.to_string().contains(\"StreamingHistory\") => show_export_instructions(),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Point inputs at the extracted Spotify export folder, never the zip","Verify filenames still match Spotify's export naming for your export year","Check the export contains extended streaming history before running analysis"],"tags":["filesystem","glob","spotify","empty-input"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}