{"record":{"id":"f5b4994507a5af85","repo":"tonhowtf/omniget","slug":"nenhuma-publica-o-v-lida-na-lista","errorCode":null,"errorMessage":"nenhuma publicação válida na lista","messagePattern":"nenhuma publicação válida na lista","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/blogs/substack.rs","lineNumber":422,"sourceCode":"            \"discover\",\n            0,\n            None,\n            Some(\"assinaturas\".into()),\n        );\n        discover(&fetcher).await?\n    } else {\n        opts.publications\n            .iter()\n            .filter_map(|p| normalize_host(p))\n            .map(|host| Subscription {\n                name: host.clone(),\n                host,\n                paid: false,\n            })\n            .collect()\n    };\n    if targets.is_empty() {\n        return Err(anyhow!(\"nenhuma publicação válida na lista\"));\n    }\n\n    let since = opts.since.trim().to_string();\n    let mut out = ArchiveResult {\n        used_session: fetcher.has_session(),\n        dest: root.to_string_lossy().to_string(),\n        publications: Vec::new(),\n        posts: 0,\n        locked: 0,\n        images: 0,\n        requests: 0,\n        files: Vec::new(),\n    };\n\n    let total = targets.len() as u64;\n    for (i, sub) in targets.iter().enumerate() {\n        crate::core::tools::report(\n            &progress,","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/blogs/substack.rs#L404-L440","documentation":"After resolving the export targets — either from the session's subscriptions or from a user-provided list of URLs/publication names — substack::run checks whether the resulting targets vector is empty. If no entry could be parsed into a valid publication (custom domain or <name>.substack.com host), the export cannot proceed and this error is raised.","triggerScenarios":"Calling run() with opts.publications containing only entries that fail host parsing (no valid substack.com or custom-domain host), or an empty manual list combined with no usable session subscriptions.","commonSituations":"User typed publication names by hand with typos or full HTML pasted in; URLs pointing to post pages rather than the publication; pasting 'substack.com' itself rather than a publication domain; non-ASCII or whitespace-only entries filtered out.","solutions":["Provide valid publication URLs or hosts (e.g. https://example.substack.com or a custom domain) in opts.publications","Log in with a session (capture cookies) so discover() can supply valid subscription targets","Strip protocol/path noise and verify each entry resolves to a publication host before building Options"],"exampleFix":"// before\nlet opts = Options { publications: vec![\"my substack\".into()], .. };\n// after\nlet opts = Options { publications: vec![\"https://mysub.substack.com\".into()], .. };","handlingStrategy":"validation","validationCode":"fn valid_host(entry: &str) -> bool {\n    let e = entry.trim();\n    e.ends_with(\".substack.com\") || (!e.contains(' ') && e.contains('.'))\n}\nlet targets: Vec<_> = opts.publications.iter().filter(|p| valid_host(p)).collect();\nif targets.is_empty() { anyhow::bail!(\"no valid publications provided\"); }","typeGuard":"fn is_publication_url(entry: &str) -> bool {\n    entry.starts_with(\"https://\") && (entry.contains(\".substack.com/\") || entry.contains(\".substack.com\"))\n}","tryCatchPattern":null,"preventionTips":["Sanitize user-entered publication lists: accept full URLs, extract and validate hosts","Prefer session-based discovery over manual lists whenever cookies are available","Show per-entry parse feedback in the UI so invalid entries are visible before export"],"tags":["validation","substack","rust","empty-list"],"backgroundTag":"empty-result-set","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"}