{"record":{"id":"a56f52ae3829efb7","repo":"tonhowtf/omniget","slug":"arquivo-n-o-encontrado","errorCode":null,"errorMessage":"arquivo não encontrado: {}","messagePattern":"arquivo não encontrado: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/yt_chapters.rs","lineNumber":437,"sourceCode":"            &format!(\n                \"select='gt(scene,{})',showinfo\",\n                threshold.clamp(0.05, 0.95)\n            ),\n            \"-an\",\n            \"-f\",\n            \"null\",\n            \"-\",\n        ])\n        .output()\n        .await\n        .map_err(|e| anyhow!(\"o ffmpeg não iniciou: {}\", e))?;\n    Ok(parse_scene_times(&String::from_utf8_lossy(&out.stderr)))\n}\n\npub async fn run(opts: Options, progress: super::ProgressFn) -> anyhow::Result<ChaptersResult> {\n    let input = PathBuf::from(opts.input.trim());\n    if !input.exists() {\n        return Err(anyhow!(\"arquivo não encontrado: {}\", opts.input));\n    }\n    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;\n    super::report(&progress, ID, \"progress\", 0, Some(3), None);\n    let probe = crate::core::ffmpeg::probe(&input).await?;\n    let total = probe.duration_seconds;\n    if total <= 0.0 {\n        return Err(anyhow!(\"não consegui medir a duração do vídeo\"));\n    }\n\n    let mut cues: Vec<Cue> = Vec::new();\n    if !opts.subtitle_path.trim().is_empty() {\n        if let Ok(text) = std::fs::read_to_string(opts.subtitle_path.trim()) {\n            cues = super::subtitle::parse(&text).unwrap_or_default();\n            cues = super::yt_notes::dedup_cues(&cues);\n        }\n    }\n    let titled = !cues.is_empty();\n","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/yt_chapters.rs#L419-L455","documentation":"The input media file passed to yt_chapters does not exist on disk. `run` validates `opts.input` with `input.exists()` before probing, and fails with the path embedded in the message so the user can see which file was missing.","triggerScenarios":"Calling `run(opts, progress)` with `opts.input` pointing to a deleted, moved, mistyped, or not-yet-downloaded file.","commonSituations":"Downstream step assumes the download finished but it failed; typo in the path; relative path resolved from a different working directory; file on unmounted volume.","solutions":["Verify the file exists at opts.input before calling run","Use absolute paths instead of relative ones","Ensure the download/production step completed before running chapter detection","Correct the path string (check for typos or encoding issues)"],"exampleFix":"// before\nrun(Options { input: \"video.mp4\".into(), ..Default::default() }, progress).await?;\n// after\nlet input = \"/abs/path/video.mp4\";\nassert!(Path::new(input).exists(), \"missing input: {}\", input);\nrun(Options { input: input.into(), ..Default::default() }, progress).await?;","handlingStrategy":"validation","validationCode":"if !Path::new(&opts.input).exists() {\n    return Err(anyhow!(\"arquivo não encontrado: {}\", opts.input));\n}","typeGuard":null,"tryCatchPattern":"match run(opts, progress).await {\n    Err(e) if e.to_string().starts_with(\"arquivo não encontrado\") => {\n        eprintln!(\"confira o caminho do vídeo de entrada\");\n    }\n    other => other?,\n}","preventionTips":["Use absolute canonical paths","Confirm the upstream download step succeeded before chapter detection","Check file existence in UI before enabling the action"],"tags":["rust","file-io","validation","missing-file"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}