{"record":{"id":"27046e999c4aef2a","repo":"tonhowtf/omniget","slug":"unsupported-media-type-for-download","errorCode":null,"errorMessage":"Unsupported media type for download","messagePattern":"Unsupported media type for download","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/bluesky.rs","lineNumber":379,"sourceCode":"                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,\n                    torrent_id: None,\n                })\n            }\n            _ => Err(anyhow!(\"Unsupported media type for download\")),\n        }\n    }\n}\n","sourceCodeStart":361,"sourceCodeEnd":383,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/bluesky.rs#L361-L383","documentation":"Catch-all in BlueskyDownloader::download for MediaType variants other than Video, Photo, Carousel, Gif, and the ytdlp-formatted early path (e.g. MediaType::Audio or any other variant). The Bluesky downloader simply cannot download that media type.","triggerScenarios":"Calling download() with a MediaInfo whose media_type is a variant the Bluesky platform does not implement (e.g. Audio, or any future variants added to MediaType).","commonSituations":"Piping MediaInfo produced by another platform downloader into the Bluesky downloader, or code that adds a new MediaType variant without updating this match.","solutions":["Route the MediaInfo to the platform downloader that produced it, not the Bluesky one.","Check info.media_type before calling download() and handle unsupported kinds in the caller.","If you added a MediaType variant, extend this match to handle or explicitly reject it."],"exampleFix":"// before\nmatch info.media_type { ... _ => Err(anyhow!(\"Unsupported media type for download\")) }\n// after (caller)\nif !matches!(info.media_type, MediaType::Video | MediaType::Photo | MediaType::Carousel | MediaType::Gif) {\n    return Err(anyhow!(\"bluesky downloader cannot handle {:?}\", info.media_type));\n}","handlingStrategy":"type-guard","validationCode":"use MediaType::*;\nif !matches!(info.media_type, Video | Photo | Carousel | Gif) {\n    return Err(anyhow!(\"{:?} not supported by bluesky downloader\", info.media_type));\n}","typeGuard":"fn is_bluesky_downloadable(mt: &MediaType) -> bool {\n    matches!(mt, MediaType::Video | MediaType::Photo | MediaType::Carousel | MediaType::Gif)\n}","tryCatchPattern":"match downloader.download(&info, &opts, tx).await {\n    Err(e) if e.to_string() == \"Unsupported media type for download\" => {\n        eprintln!(\"route {:?} to its originating platform downloader\", info.media_type);\n    }\n    other => other,\n}","preventionTips":["Only pass Bluesky-produced MediaInfo to the Bluesky downloader","Check media_type before dispatching to a platform downloader","Update the match when adding new MediaType variants (make it exhaustive instead of _)"],"tags":["bluesky","download","unsupported-media"],"backgroundTag":"unsupported-operation","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"}