{"record":{"id":"c017f7373611471d","repo":"tonhowtf/omniget","slug":"no-gif-url-available","errorCode":null,"errorMessage":"No GIF URL available","messagePattern":"No GIF URL available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/bluesky.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/omniget-core/src/platforms/bluesky.rs#L339-L375","documentation":"Thrown in BlueskyDownloader::download for MediaType::Gif when available_qualities is empty, so no GIF URL exists to download. Like the HLS case, it indicates a MediaInfo whose media_type claims a GIF but carries no quality entries.","triggerScenarios":"download() called with a GIF-typed MediaInfo whose available_qualities vec is empty — e.g. built manually or stripped by a filter.","commonSituations":"Custom tooling constructing MediaInfo for Tenor GIFs without populating the url, or code clearing qualities after a failed prefetch.","solutions":["Ensure at least one VideoQuality with the Tenor GIF URL is present before download().","Re-run get_media_info on the original post URL to rebuild the MediaInfo.","Skip download and report 'no GIF URL' gracefully in the caller."],"exampleFix":"// before\nlet info = MediaInfo { media_type: MediaType::Gif, available_qualities: vec![], .. };\n// after\nlet info = MediaInfo { media_type: MediaType::Gif,\n    available_qualities: vec![VideoQuality { label: \"original\".into(), url: gif_url, format: \"gif\".into(), .. }], .. };","handlingStrategy":"validation","validationCode":"if info.media_type == MediaType::Gif && info.available_qualities.first().map_or(true, |q| q.url.is_empty()) {\n    return Err(anyhow!(\"GIF MediaInfo has no url; refetch via get_media_info\"));\n}","typeGuard":"fn has_gif_url(info: &MediaInfo) -> bool {\n    matches!(info.media_type, MediaType::Gif)\n        && info.available_qualities.first().map_or(false, |q| !q.url.is_empty())\n}","tryCatchPattern":"match downloader.download(&info, &opts, tx).await {\n    Err(e) if e.to_string() == \"No GIF URL available\" => {\n        eprintln!(\"GIF url missing; refetching info\");\n        let fresh = downloader.get_media_info(&original_url).await?;\n        downloader.download(&fresh, &opts, tx).await\n    }\n    other => other,\n}","preventionTips":["Always populate available_qualities with the Tenor URL for GIF media","Keep the original post URL alongside MediaInfo so you can re-fetch on inconsistency","Validate MediaInfo before handing it to download()"],"tags":["bluesky","download","gif"],"backgroundTag":"empty-required-field","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"}