tonhowtf/omniget · error

não achei nenhuma faixa em

Error message

não achei nenhuma faixa em {}

What it means

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.

Solutions

  1. Open the source and confirm it actually contains playlist track entries
  2. Check the file extension is correct — parse_source relies on it to choose the parser
  3. Re-export or re-download the playlist if it is empty or corrupted
  4. Ensure URLs point at real playlist endpoints, not HTML pages
  5. Update the tool if the playlist format changed

Example fix

// before
let src = Path::new("empty.m3u"); // 0 tracks
// after
let src = Path::new("playlist.m3u");
assert!(fs::metadata(src)?.len() > 0); // non-empty real playlist
Defensive patterns

Strategy: validation

Validate before calling

let text = fs::read_to_string(&src)?;
if parse_source(&text, &ext)?.is_empty() {
    return Err(anyhow!("playlist vazia: {}", src.display()));
}

Type guard

fn is_nonempty_playlist(src: &Path) -> bool {
    fs::read_to_string(src)
        .map(|t| parse_source(&t, &ext_of(src)).map_or(false, |t| !t.is_empty()))
        .unwrap_or(false)
}

Try / catch

match playlist::run(opts, progress).await {
    Err(e) if e.to_string().contains("não achei nenhuma faixa") => eprintln!("a playlist está vazia ou num formato não suportado"),
    Err(e) => return Err(e),
    Ok(r) => use(r),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/0177003f63f20a67. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/music/playlist.rs:688

    s.push_str(&format!("NumberOfEntries={}\n", entries.len()));
    s.push_str("Version=2\n");
    s
}

// ── Execução ────────────────────────────────────────────────────────────

pub fn run(opts: &PlaylistOptions, p: &ProgressFn) -> Result<PlaylistResult> {
    report(p, TOOL_ID, "started", 0, None, None);
    let src = PathBuf::from(&opts.source);
    let text = std::fs::read_to_string(&src)
        .with_context(|| format!("não consegui ler {}", src.display()))?;
    let ext = src
        .extension()
        .map(|e| e.to_string_lossy().to_string())
        .unwrap_or_default();
    let tracks = parse_source(&text, &ext)?;
    if tracks.is_empty() {
        anyhow::bail!("não achei nenhuma faixa em {}", src.display());
    }

    report(
        p,
        TOOL_ID,
        "progress",
        0,
        Some(tracks.len() as u64),
        Some("lendo a pasta".to_string()),
    );
    let files = index_dirs(&opts.music_dirs);
    let threshold = opts.threshold.min(100);
    let hits = match_tracks(&tracks, &files, threshold, p);

    let out_dir = PathBuf::from(&opts.out_dir);
    std::fs::create_dir_all(&out_dir)?;
    let copy_dir = opts.copy_to.as_ref().map(PathBuf::from);
    if let Some(d) = &copy_dir {

View on GitHub (pinned to 8600b91f42)