{"record":{"id":"700a744746259270","repo":"tonhowtf/omniget","slug":"aponte-os-exports-do-letterboxd-do-trakt-ou-do-goodreads","errorCode":null,"errorMessage":"aponte os exports do Letterboxd, do Trakt ou do Goodreads (JSON ou CSV)","messagePattern":"aponte os exports do Letterboxd, do Trakt ou do Goodreads \\(JSON ou CSV\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/lists/merge.rs","lineNumber":515,"sourceCode":"        s.push_str(&format!(\" · {}×\", e.times));\n    }\n    s.push('\\n');\n    if !e.review.is_empty() {\n        let review = e.review.replace('\\n', \" \");\n        s.push_str(&format!(\"  > {}\\n\", review.trim()));\n    }\n    s\n}\n\n// ── Execução ────────────────────────────────────────────────────────────\n\npub fn run(opts: &Options, p: &ProgressFn) -> Result<MergeResult> {\n    if opts.dest.trim().is_empty() {\n        return Err(anyhow!(\"escolha a pasta de destino\"));\n    }\n    let files = collect_files(&opts.inputs);\n    if files.is_empty() && opts.spotify.is_empty() {\n        return Err(anyhow!(\n            \"aponte os exports do Letterboxd, do Trakt ou do Goodreads (JSON ou CSV)\"\n        ));\n    }\n    let total = (files.len() + opts.spotify.len().min(1)) as u64;\n    let mut sources = Vec::new();\n    let mut all: Vec<Entry> = Vec::new();\n\n    for (i, f) in files.iter().enumerate() {\n        let name = f.to_string_lossy().to_string();\n        report(\n            p,\n            TOOL_ID,\n            \"progress\",\n            i as u64,\n            Some(total),\n            Some(name.clone()),\n        );\n        let Ok(text) = std::fs::read_to_string(f) else {","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/lists/merge.rs#L497-L533","documentation":"merge::run aborts early when there is nothing to merge: collect_files found zero readable input files and no Spotify playlists were configured. The library requires at least one source (Letterboxd/Trakt/Goodreads export in JSON or CSV, or a Spotify list) before starting the merge pipeline.","triggerScenarios":"Calling run(opts) where opts.inputs contains no existing files (collect_files returns empty) AND opts.spotify is empty; typically passing an empty inputs vec, a path to a nonexistent file, or forgetting to set the spotify field.","commonSituations":"User left the 'inputs' list empty in the merge dialog; input files were moved/deleted before the merge ran; a typo in the file path so collect_files silently skipped it; user thought Spotify-only merges were auto-detected but left opts.spotify empty too.","solutions":["Add at least one valid Letterboxd, Trakt or Goodreads export file (JSON or CSV) to opts.inputs","Check the file paths in opts.inputs exist on disk (typos, moved files)","If merging only from Spotify, populate opts.spotify with at least one playlist identifier","Ensure opts.dest is also non-empty, otherwise the earlier 'escolha a pasta de destino' error fires first"],"exampleFix":"// before\nlet opts = Options { inputs: vec![], spotify: vec![], dest: \"/tmp/out\".into(), .. };\n// after\nlet opts = Options { inputs: vec![\"/tmp/letterboxd-export.csv\".into()], spotify: vec![], dest: \"/tmp/out\".into(), .. };","handlingStrategy":"validation","validationCode":"if opts.inputs.iter().all(|p| !std::path::Path::new(p).exists()) && opts.spotify.is_empty() {\n    eprintln!(\"forneça pelo menos um export (Letterboxd/Trakt/Goodreads) ou uma lista do Spotify\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always verify input files exist before constructing Options","Require at least one source (file or Spotify) in your UI before enabling the merge action","Log resolved input paths after collect_files to catch silent path mistakes"],"tags":["merge","missing-input","validation"],"backgroundTag":"missing-required-argument","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"}