{"record":{"id":"5b772ff6a071a835","repo":"tonhowtf/omniget","slug":"nenhum-arquivo-de-udio-para-procurar-letra","errorCode":null,"errorMessage":"nenhum arquivo de áudio para procurar letra","messagePattern":"nenhum arquivo de áudio para procurar letra","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/music/lyrics.rs","lineNumber":432,"sourceCode":"            let p = entry.path();\n            let audio = p\n                .extension()\n                .map(|e| AUDIO_EXTS.contains(&e.to_string_lossy().to_lowercase().as_str()))\n                .unwrap_or(false);\n            if entry.file_type().is_file() && audio {\n                out.push(p.to_path_buf());\n            }\n        }\n    }\n    out.sort();\n    out.dedup();\n    out\n}\n\npub async fn run(opts: LyricsOptions, p: ProgressFn) -> Result<LyricsResult> {\n    let inputs = collect_inputs(&opts);\n    if inputs.is_empty() {\n        anyhow::bail!(\"nenhum arquivo de áudio para procurar letra\");\n    }\n    let http = client()?;\n    let total = inputs.len() as u64;\n    report(&p, TOOL_ID, \"started\", 0, Some(total), None);\n\n    let mut result = LyricsResult {\n        total: inputs.len(),\n        synced: 0,\n        plain: 0,\n        estimated: 0,\n        not_found: 0,\n        tracks: Vec::new(),\n    };\n\n    for (i, path) in inputs.iter().enumerate() {\n        let meta = guess_meta(path);\n        let stem = path\n            .file_stem()","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/music/lyrics.rs#L414-L450","documentation":"The lyrics tool collects its audio inputs from the provided options before starting. If the resulting input list is empty there is no file to search lyrics for, so it aborts immediately with this message.","triggerScenarios":"Calling the lyrics `run` function with options that resolve to zero audio files — no files/directories given, paths pointing at nothing audio-related, or all inputs filtered out.","commonSituations":"Forgetting to set the input file/directory option; passing a directory with no supported audio extensions; typo in the path so collect_inputs finds nothing; CLI flag not wired to the options struct.","solutions":["Pass at least one supported audio file or a directory containing audio files in the options","Verify the configured paths exist and use supported audio extensions","Check that CLI/config values are actually copied into LyricsOptions before calling run","Log collect_inputs results (or count files beforehand) to confirm inputs are non-empty"],"exampleFix":"// before\nlet opts = LyricsOptions { ..Default::default() }; // no inputs\nrun(opts, progress).await?;\n// after\nlet opts = LyricsOptions { files: vec![audio_path], ..Default::default() };\nassert!(!collect_inputs(&opts).is_empty());\nrun(opts, progress).await?;","handlingStrategy":"validation","validationCode":"let inputs = collect_inputs(&opts);\nif inputs.is_empty() {\n    return Err(anyhow!(\"forneça ao menos um arquivo de áudio\"));\n}","typeGuard":"fn has_audio_inputs(opts: &LyricsOptions) -> bool {\n    !collect_inputs(opts).is_empty()\n}","tryCatchPattern":"match lyrics::run(opts, progress).await {\n    Err(e) if e.to_string().contains(\"nenhum arquivo de áudio\") => eprintln!(\"adicione arquivos de áudio às opções\"),\n    Err(e) => return Err(e),\n    Ok(r) => handle(r),\n}","preventionTips":["Always populate files/directory options before calling run","Filter input lists to supported audio extensions beforehand","Validate paths exist before invoking the tool"],"tags":["music","lyrics","missing-input"],"backgroundTag":"empty-required-field","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"}