{"record":{"id":"0177003f63f20a67","repo":"tonhowtf/omniget","slug":"n-o-achei-nenhuma-faixa-em","errorCode":null,"errorMessage":"não achei nenhuma faixa em {}","messagePattern":"não achei nenhuma faixa em (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/music/playlist.rs","lineNumber":688,"sourceCode":"    s.push_str(&format!(\"NumberOfEntries={}\\n\", entries.len()));\n    s.push_str(\"Version=2\\n\");\n    s\n}\n\n// ── Execução ────────────────────────────────────────────────────────────\n\npub fn run(opts: &PlaylistOptions, p: &ProgressFn) -> Result<PlaylistResult> {\n    report(p, TOOL_ID, \"started\", 0, None, None);\n    let src = PathBuf::from(&opts.source);\n    let text = std::fs::read_to_string(&src)\n        .with_context(|| format!(\"não consegui ler {}\", src.display()))?;\n    let ext = src\n        .extension()\n        .map(|e| e.to_string_lossy().to_string())\n        .unwrap_or_default();\n    let tracks = parse_source(&text, &ext)?;\n    if tracks.is_empty() {\n        anyhow::bail!(\"não achei nenhuma faixa em {}\", src.display());\n    }\n\n    report(\n        p,\n        TOOL_ID,\n        \"progress\",\n        0,\n        Some(tracks.len() as u64),\n        Some(\"lendo a pasta\".to_string()),\n    );\n    let files = index_dirs(&opts.music_dirs);\n    let threshold = opts.threshold.min(100);\n    let hits = match_tracks(&tracks, &files, threshold, p);\n\n    let out_dir = PathBuf::from(&opts.out_dir);\n    std::fs::create_dir_all(&out_dir)?;\n    let copy_dir = opts.copy_to.as_ref().map(PathBuf::from);\n    if let Some(d) = &copy_dir {","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/music/playlist.rs#L670-L706","documentation":"The playlist tool parses a playlist source (file or URL) into a list of tracks. If parsing succeeded structurally but yielded zero tracks, the tool aborts because there is nothing to process, embedding the source path in the message.","triggerScenarios":"Calling playlist `run` on a source whose parsed content contains no track entries — an empty playlist file, a format the parser misreads, or an HTML page instead of an actual playlist.","commonSituations":"Pointing at an empty or corrupted .m3u/.pls file; giving a URL that returns a login/error page rather than playlist data; an unsupported playlist variant whose syntax the parser ignores.","solutions":["Open the source and confirm it actually contains playlist track entries","Check the file extension is correct — parse_source relies on it to choose the parser","Re-export or re-download the playlist if it is empty or corrupted","Ensure URLs point at real playlist endpoints, not HTML pages","Update the tool if the playlist format changed"],"exampleFix":"// before\nlet src = Path::new(\"empty.m3u\"); // 0 tracks\n// after\nlet src = Path::new(\"playlist.m3u\");\nassert!(fs::metadata(src)?.len() > 0); // non-empty real playlist","handlingStrategy":"validation","validationCode":"let text = fs::read_to_string(&src)?;\nif parse_source(&text, &ext)?.is_empty() {\n    return Err(anyhow!(\"playlist vazia: {}\", src.display()));\n}","typeGuard":"fn is_nonempty_playlist(src: &Path) -> bool {\n    fs::read_to_string(src)\n        .map(|t| parse_source(&t, &ext_of(src)).map_or(false, |t| !t.is_empty()))\n        .unwrap_or(false)\n}","tryCatchPattern":"match playlist::run(opts, progress).await {\n    Err(e) if e.to_string().contains(\"não achei nenhuma faixa\") => eprintln!(\"a playlist está vazia ou num formato não suportado\"),\n    Err(e) => return Err(e),\n    Ok(r) => use(r),\n}","preventionTips":["Confirm the playlist file has track entries before processing","Use the correct file extension so the right parser is selected","Download playlists from real endpoints, not HTML error pages"],"tags":["playlist","empty-result","parsing"],"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"}