{"record":{"id":"970d4cc062b806f4","repo":"tonhowtf/omniget","slug":"unsupported-media-type-970d4c","errorCode":null,"errorMessage":"Unsupported media type","messagePattern":"Unsupported media type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/reddit/mod.rs","lineNumber":767,"sourceCode":"                        Some(&opts.cancel_token),\n                    )\n                    .await?;\n\n                    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            _ => Err(anyhow!(\"Unsupported media type\")),\n        }\n    }\n}\n","sourceCodeStart":749,"sourceCodeEnd":771,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/reddit/mod.rs#L749-L771","documentation":"The MediaType match in native_download has no executable arm for the encountered variant, so the catch-all `_ =>` returns this error. It means the post's media type is not one of the supported Photo/Video/Gallery download paths.","triggerScenarios":"Calling download on a Reddit post whose MediaType is a variant not handled by native_download (e.g. self-post/text, link, or a newly added media type).","commonSituations":"Users pasting a URL to a text/self post or external link, or a library update introducing a new Reddit media type not yet handled in the match.","solutions":["Check the media type before calling download and reject unsupported kinds up front","Add a match arm for the missing MediaType variant or filter posts to supported types","Improve the error message to include the actual media type for debugging","Update the parser if new Reddit post types should be supported"],"exampleFix":"// before\n_ => Err(anyhow!(\"Unsupported media type\")),\n// after\nother => Err(anyhow!(\"Unsupported media type: {:?}\", other)),","handlingStrategy":"validation","validationCode":"match media_type {\n    MediaType::Photo | MediaType::Video | MediaType::Gallery => Ok(()),\n    other => Err(format!(\"unsupported media type: {:?}\", other)),\n}","typeGuard":null,"tryCatchPattern":"match download(url).await {\n    Err(e) if e.to_string() == \"Unsupported media type\" => skip_post(url),\n    other => other,\n}","preventionTips":["Only pass URLs of known downloadable post types","Exhaustively match MediaType variants so new variants fail at compile time","Include the variant in the error message for diagnostics"],"tags":["downloader","unsupported-type","reddit"],"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"}