{"record":{"id":"7250e1374f01ba4d","repo":"tonhowtf/omniget","slug":"nenhum-url-de-imagem-mod","errorCode":null,"errorMessage":"Nenhum URL de imagem","messagePattern":"Nenhum URL de imagem","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/reddit/mod.rs","lineNumber":706,"sourceCode":"                    url,\n                    &output,\n                    progress,\n                    Some(&opts.cancel_token),\n                )\n                .await?;\n\n                Ok(DownloadResult {\n                    file_path: output,\n                    file_size_bytes: bytes,\n                    duration_seconds: 0.0,\n                    torrent_id: None,\n                })\n            }\n            MediaType::Photo => {\n                let quality = info\n                    .available_qualities\n                    .first()\n                    .ok_or_else(|| anyhow!(\"Nenhum URL de imagem\"))?;\n                let ext = &quality.format;\n                let output = opts.output_dir.join(format!(\n                    \"{}.{}\",\n                    sanitize_filename::sanitize(&info.title),\n                    ext\n                ));\n                let bytes = direct_downloader::download_direct(\n                    &self.client,\n                    &quality.url,\n                    &output,\n                    progress,\n                    Some(&opts.cancel_token),\n                )\n                .await?;\n\n                Ok(DownloadResult {\n                    file_path: output,\n                    file_size_bytes: bytes,","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/reddit/mod.rs#L688-L724","documentation":"native_download fails when the Reddit media info has an empty available_qualities list for a Photo post. `.first()` returns None, so the code short-circuits with this anyhow error instead of panicking. It indicates Reddit returned metadata but no downloadable image URL/quality entries.","triggerScenarios":"Downloading a Reddit photo post whose info resolution succeeded but produced no qualities (e.g. deleted/removed media, gallery item stripped, or parser failed to extract any format entries).","commonSituations":"Posts removed by moderators, images hosted on a CDN that returned an error page parsed as valid info, or Reddit API shape changes that leave available_qualities empty.","solutions":["Re-fetch media info; transient parser/CDN issues may resolve","Verify the post URL is a real photo post and still publicly available","Update the Reddit scraper/parser to handle the current Reddit response shape","Check logs of available_qualities for the post to confirm it is genuinely empty"],"exampleFix":"let quality = info.available_qualities.first().ok_or_else(|| anyhow!(\"Nenhum URL de imagem\"))?;\n// after (with fallback)\nlet quality = info.available_qualities.first().with_context(|| format!(\"Nenhum URL de imagem para post {}\", info.title))?;","handlingStrategy":"validation","validationCode":"if info.available_qualities.is_empty() {\n    return Err(format!(\"post '{}' has no downloadable image qualities\", info.title));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check available_qualities is non-empty before calling native_download for photos","Validate media info right after parsing, not at download time","Log parsed qualities to detect parser regressions early"],"tags":["downloader","empty-url","reddit"],"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"}