{"record":{"id":"57da89732b8dca28","repo":"tonhowtf/omniget","slug":"unsupported-media-type-for-download-mod","errorCode":null,"errorMessage":"Unsupported media type for download","messagePattern":"Unsupported media type for download","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bluesky/mod.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/src/platforms/bluesky/mod.rs#L361-L383","documentation":"The Bluesky `download` implementation only handles a fixed set of `MediaType` variants (e.g. Image, Video, Gif); the catch-all `_` arm rejects any other media type. It signals that the requested media kind has no download path implemented for this platform.","triggerScenarios":"Calling `download` on Bluesky MediaInfo whose `media_type` matches none of the handled arms — for instance unsupported/unknown media types returned by the API or new enum variants added without updating this match.","commonSituations":"New Bluesky media kinds (e.g. external embeds, polls, audio) appearing in the API, an enum variant added in a refactor that left the trailing `_ => Err(...)` in place, or mixed-embed posts where the resolved type is not a downloadable one.","solutions":["Check which MediaType is being passed and add a download implementation for that variant.","Filter unsupported media types out before calling download so only supported kinds reach it.","Update the match to handle newly added MediaType variants instead of falling into `_`.","Improve the error message to include the actual media type for easier triage."],"exampleFix":"// before\n_ => Err(anyhow!(\"Unsupported media type for download\")),\n// after\nother => Err(anyhow!(\"Unsupported media type for download: {:?}\", other)),","handlingStrategy":"validation","validationCode":"// Rust, before calling download\nconst SUPPORTED: &[MediaType] = &[MediaType::Image, MediaType::Video, MediaType::Gif];\nif !SUPPORTED.contains(&info.media_type) {\n    // skip or route to another platform handler\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a list of supported MediaTypes per platform and check it before invoking download.","Avoid relying on the `_` arm — handle every MediaType variant explicitly so the compiler flags new ones.","Include the offending variant in the error message for faster triage."],"tags":["downloader","media-type","bluesky","unsupported"],"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"}