{"record":{"id":"260b1940045c3129","repo":"tonhowtf/omniget","slug":"n-o-consegui-ler","errorCode":null,"errorMessage":"não consegui ler {}","messagePattern":"não consegui ler (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/lists/letterboxd.rs","lineNumber":372,"sourceCode":"    let dest = PathBuf::from(opts.dest.trim());\n    if opts.dest.trim().is_empty() {\n        return Err(anyhow!(\"escolha a pasta de destino\"));\n    }\n    std::fs::create_dir_all(&dest)?;\n    let f = Fetcher::new(opts.delay_ms, opts.session_netscape.as_deref(), DOMAIN)?;\n\n    // 1. O ZIP: local ou baixado com a sessão.\n    let (bytes, source) = match opts.zip_path.as_deref().map(str::trim) {\n        Some(path) if !path.is_empty() => {\n            report(&p, TOOL_ID, \"progress\", 0, Some(3), Some(path.to_string()));\n            (\n                std::fs::read(path).with_context(|| format!(\"não consegui ler {}\", path))?,\n                path.to_string(),\n            )\n        }\n        _ => {\n            if !f.has_session() {\n                return Err(anyhow!(\n                    \"sem sessão do Letterboxd: capture os cookies de letterboxd.com na extensão, ou aponte um ZIP já baixado de letterboxd.com/settings/data/\"\n                ));\n            }\n            report(\n                &p,\n                TOOL_ID,\n                \"progress\",\n                0,\n                Some(3),\n                Some(EXPORT_URL.to_string()),\n            );\n            let (b, ctype) = f.get_bytes(EXPORT_URL).await?;\n            if ctype.contains(\"text/html\") || b.len() < 200 {\n                let body = String::from_utf8_lossy(&b);\n                if is_cloudflare_wall(&body) {\n                    return Err(anyhow!(\n                        \"o Cloudflare do Letterboxd barrou o download. Abra letterboxd.com no navegador, passe pelo \\\"Just a moment\\\" e capture os cookies de novo na extensão — o cf_clearance precisa vir junto\"\n                    ));","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/lists/letterboxd.rs#L354-L390","documentation":"This is a with_context-wrapped io::Error from std::fs::read when the tool could not read the user-supplied Letterboxd ZIP file at opts.zip_path. The context message interpolates the offending path, so 'não consegui ler <path>' identifies exactly which file failed to open.","triggerScenarios":"Calling run with opts.zip_path pointing to a file that doesn't exist, was moved/deleted, or lacks read permission; std::fs::read(path) returns Err and it is propagated via the ? operator in run().","commonSituations":"Typo in the ZIP path; file downloaded to Downloads folder but a different path given; ZIP deleted between selection and run; permission restrictions (sandboxed app can't read user-chosen path).","solutions":["Verify the path exists with fs::metadata before calling run and fix any typo.","Re-download the ZIP from letterboxd.com/settings/data/ and pass the new path.","Check file permissions and, on macOS, ensure the app has Files/Folder access.","Alternatively drop the zip_path and provide Letterboxd session cookies so the tool downloads the export itself."],"exampleFix":"// before\nlet opts = Options { zip_path: Some(\"~/Downloads/export.zip\".into()), .. }; // ~ not expanded\nrun(&opts, p).await?;\n// after\nlet expanded = shellexpand::tilde(\"~/Downloads/export.zip\").to_string();\nassert!(std::path::Path::new(&expanded).is_file(), \"zip not found: {expanded}\");\nlet opts = Options { zip_path: Some(expanded), .. };\nrun(&opts, p).await?;","handlingStrategy":"validation","validationCode":"if let Some(zip) = opts.zip_path.as_deref().map(str::trim) {\n    let meta = std::fs::metadata(zip)\n        .with_context(|| format!(\"não consegui ler {zip}\"))?;\n    anyhow::ensure!(meta.is_file(), \"{zip} não é um arquivo\");\n}","typeGuard":"fn zip_readable(zip_path: &str) -> bool {\n    std::path::Path::new(zip_path.trim()).is_file()\n}","tryCatchPattern":"match letterboxd::run(&opts, &p).await {\n    Err(e) if e.to_string().starts_with(\"não consegui ler\") => {\n        eprintln!(\"verifique o caminho do ZIP: {e}\");\n    }\n    other => other?,\n}","preventionTips":["Use absolute, fully expanded paths (no ~ or relative shortcuts)","Re-download the export from letterboxd.com/settings/data/ if the file was moved or deleted","Check app sandbox/permissions for reading user folders","Verify existence with fs::metadata before constructing Options"],"tags":["io","file","letterboxd","zip"],"backgroundTag":"file-read-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}