tonhowtf/omniget · error

nenhum dos arquivos apontados tem um formato que eu saiba…

Error message

nenhum dos arquivos apontados tem um formato que eu saiba ler

What it means

After iterating all candidate files, run checks whether any parser produced entries. If `all` is empty, none of the supplied files matched a format the library can read (Letterboxd/Trakt/Goodreads JSON/CSV), so it fails rather than returning an empty merge result.

Solutions

  1. Verify each file in opts.inputs is an actual Letterboxd/Trakt/Goodreads export (unpack the Letterboxd ZIP first)
  2. Open the file and confirm it is valid JSON or CSV with the expected columns/keys
  3. Re-download the export from the service; a partial or still-generating file may be empty
  4. Check the file encoding is UTF-8 and CSV delimiter is a comma
  5. Confirm at least one parser for the format exists in the lists module version you are using

Example fix

// before
let opts = Options { inputs: vec!["/tmp/letterboxd.zip".into()], .. };
// after
let opts = Options { inputs: vec!["/tmp/letterboxd/unpacked/watchlist.csv".into()], .. };
Defensive patterns

Strategy: validation

Validate before calling

fn looks_like_export(path: &Path) -> bool {
    let name = path.file_name().map(|s| s.to_string_lossy().to_lowercase()).unwrap_or_default();
    name.ends_with(".csv") || name.ends_with(".json")
}

Prevention

When it happens

Trigger: Calling run(opts) with files that exist but are not parseable exports: wrong file (e.g. a ZIP not yet expanded, an HTML page saved instead of CSV), CSV with unexpected headers, truncated/empty export files, or unsupported JSON shapes.

Common situations: User downloaded the Letterboxd ZIP but pointed at the ZIP instead of the unpacked CSVs; Goodreads export was still generating and contained only a header row; Trakt JSON is from an unofficial export with a different schema; CSV re-saved by Excel with a different delimiter/encoding.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/lists/merge.rs:577

        for (_, text) in &srcs {
            plays.extend(crate::core::tools::music::history::parse_history(
                text,
                opts.min_ms,
            ));
        }
        let entries = spotify_entries(&plays, opts.min_plays);
        if !entries.is_empty() {
            sources.push(SourceCount {
                source: "spotify".into(),
                file: opts.spotify.join(", "),
                entries: entries.len(),
            });
            all.extend(entries);
        }
    }

    if all.is_empty() {
        return Err(anyhow!(
            "nenhum dos arquivos apontados tem um formato que eu saiba ler"
        ));
    }
    if opts.only_dated {
        all.retain(|e| !e.date.is_empty());
    }
    let before = all.len();
    let (entries, merged) = if opts.dedup {
        dedup(all)
    } else {
        let mut a = all;
        a.sort_by(|x, y| y.date.cmp(&x.date).then(x.title.cmp(&y.title)));
        (a, 0)
    };
    tracing::debug!("media-diary: {} linhas, {} juntadas", before, merged);

    let dest = PathBuf::from(opts.dest.trim());
    let formats = if opts.formats.is_empty() {

View on GitHub (pinned to 8600b91f42)