{"record":{"id":"5592cb2c9a3f6bf6","repo":"tonhowtf/omniget","slug":"no-gif-url-available-mod","errorCode":null,"errorMessage":"No GIF URL available","messagePattern":"No GIF URL available","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bluesky/mod.rs","lineNumber":357,"sourceCode":"                    total_bytes += bytes;\n                    last_path = output;\n\n                    let percent = ((i + 1) as f64 / count as f64) * 100.0;\n                    let _ = progress.send(ProgressUpdate::percent(percent)).await;\n                }\n\n                Ok(DownloadResult {\n                    file_path: last_path,\n                    file_size_bytes: total_bytes,\n                    duration_seconds: 0.0,\n                    torrent_id: None,\n                })\n            }\n            MediaType::Gif => {\n                let gif_url = &info\n                    .available_qualities\n                    .first()\n                    .ok_or_else(|| anyhow!(\"No GIF URL available\"))?\n                    .url;\n\n                let filename = format!(\"{}.gif\", sanitize_filename::sanitize(&info.title));\n                let output = opts.output_dir.join(&filename);\n\n                let bytes = direct_downloader::download_direct(\n                    &self.client,\n                    gif_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,","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bluesky/mod.rs#L339-L375","documentation":"During a Bluesky GIF download, the downloader takes the first entry of `info.available_qualities` and errors when that list is empty. It means the platform layer produced MediaInfo for a GIF but never populated any downloadable quality/URL entry, so there is nothing to pass to the direct downloader.","triggerScenarios":"Calling `download` with `MediaType::Gif` info whose `available_qualities` vec is empty — e.g. the Bluesky media parse step found a GIF but failed to extract its blob/CDN URL, or the media record had no embedded variant URLs.","commonSituations":"Posts with animated GIFs stored as blobs whose URL extraction silently failed, deleted or access-restricted media, or schema changes in the Bluesky API that stop URL population while the media type detection still succeeds.","solutions":["Check why `available_qualities` is empty before download: log the MediaInfo produced by get_media_info and fix the URL-extraction code for GIF blobs.","Verify the post/media still exists and is publicly accessible on Bluesky.","Construct a fallback GIF URL from the blob CID/ref when the qualities list is empty.","Return a more descriptive error that includes the post URL to aid debugging."],"exampleFix":"// before\nlet gif_url = &info.available_qualities.first().ok_or_else(|| anyhow!(\"No GIF URL available\"))?.url;\n// after\nlet gif_url = info\n    .available_qualities\n    .first()\n    .map(|q| q.url.clone())\n    .or_else(|| info.blob_url.clone())\n    .ok_or_else(|| anyhow!(\"No GIF URL available for post (qualities list empty)\"))?;","handlingStrategy":"validation","validationCode":"// Rust, before calling download\nif info.media_type == MediaType::Gif && info.available_qualities.is_empty() {\n    return Err(anyhow!(\"Skipping GIF download: no URL in available_qualities\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate MediaInfo completeness (non-empty qualities with URLs) at the platform layer before returning it.","Log MediaInfo when qualities are empty to catch URL-extraction regressions early.","Add tests with real Bluesky GIF post payloads to keep URL extraction working."],"tags":["downloader","media","bluesky","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"}