{"record":{"id":"4ebf356045fb34b1","repo":"tonhowtf/omniget","slug":"no-url-found-in-mediainfo","errorCode":null,"errorMessage":"No URL found in MediaInfo","messagePattern":"No URL found in MediaInfo","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/magnet.rs","lineNumber":97,"sourceCode":"                url: url.to_string(),\n                format: \"torrent\".to_string(),\n            }],\n            media_type: MediaType::Video,\n            file_size_bytes: None,\n        })\n    }\n\n    async fn download(\n        &self,\n        info: &MediaInfo,\n        opts: &DownloadOptions,\n        progress: mpsc::Sender<ProgressUpdate>,\n    ) -> anyhow::Result<DownloadResult> {\n        let _ = progress.send(ProgressUpdate::percent(0.0)).await;\n\n        let url = match info.available_qualities.first() {\n            Some(q) => &q.url,\n            None => anyhow::bail!(\"No URL found in MediaInfo\"),\n        };\n\n        let output_dir = &opts.output_dir;\n\n        // Get or create the shared session, recreating if output_dir changed\n        let session = {\n            let mut guard = self.session.lock().await;\n            let mut dir_guard = self.session_output_dir.lock().await;\n            let need_new_session = match (&*guard, &*dir_guard) {\n                (Some(_), Some(prev_dir)) => prev_dir != output_dir,\n                (None, _) => true,\n                _ => true,\n            };\n            if need_new_session {\n                if guard.is_some() {\n                    tracing::info!(\"[magnet] output dir changed, recreating session\");\n                }\n                let listen_port = opts.torrent_listen_port.unwrap_or(6881).min(65525);","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/magnet.rs#L79-L115","documentation":"magnet.rs raises this in download() when MediaInfo.available_qualities is empty, so there is no candidate URL to download. The resolver produced a MediaInfo struct but with no usable quality/URL entries, so the downloader bails immediately at the first progress update (0%).","triggerScenarios":"Calling download() with opts/info whose available_qualities vector is empty: match info.available_qualities.first() { Some(q) => &q.url, None => bail!(\"No URL found in MediaInfo\") } at magnet.rs:97.","commonSituations":"Magnet metadata fetch returned torrents/files but the quality-extraction step matched nothing (unsupported file types, empty torrent); resolver ran in list-only mode and produced entries without URLs; upstream metadata parsing changed shape after a library update.","solutions":["Validate info.available_qualities is non-empty before calling download(); return a clearer upstream error if it is empty.","Check how MediaInfo was produced: ensure the resolver populated available_qualities (not list-only mode, no empty torrent).","Inspect the magnet/metadata response — a torrent with zero files or only unsupported entries yields no URLs.","Update/fix the platform resolver so quality URLs are extracted for this content type."],"exampleFix":"// before\nlet url = match info.available_qualities.first() {\n    Some(q) => &q.url,\n    None => anyhow::bail!(\"No URL found in MediaInfo\"),\n};\n// after\nif info.available_qualities.is_empty() {\n    anyhow::bail!(\n        \"Torrent '{}' contains no downloadable files\",\n        info.title\n    );\n}\nlet url = &info.available_qualities[0].url;","handlingStrategy":"validation","validationCode":"// before calling download\nif info.available_qualities.is_empty() {\n    return Err(anyhow!(\n        \"No downloadable files in '{}'; refusing to start download\",\n        info.title\n    ));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always inspect MediaInfo.available_qualities right after resolving","Reject torrents with zero files or only unsupported extensions early","Add a resolver test asserting qualities are populated for known magnets"],"tags":["magnet","torrent","empty-data","download"],"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"}