Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
refactor(telegram): update download_media to use new media_to_location and download_parallel methods
Tonho8ac8a68f3278
diff --git a/src-tauri/src/platforms/telegram/api.rs b/src-tauri/src/platforms/telegram/api.rsindex 0de0a6a4..1c8024b5 100644--- a/src-tauri/src/platforms/telegram/api.rs+++ b/src-tauri/src/platforms/telegram/api.rs@@ -537,16 +537,15 @@ pub async fn download_media(&client, chat_id, access_hash, is_channel, message_id,).await?;- let (location, total_size) = super::parallel_download::media_to_input_location(&raw_media)+ let media = super::parallel_download::media_to_location(&raw_media).ok_or_else(|| anyhow::anyhow!("Unsupported media type"))?;if ref_attempt == 0 {- tracing::info!("[tg-perf] download_media: total_size={}", total_size);+ tracing::info!("[tg-perf] download_media: size={}, dc={}", media.size, media.dc_id);}- let downloadable = super::parallel_download::DownloadableLocation::new(location, total_size);- let result = super::parallel_download::download_with_iter(- &client, &downloadable, total_size, &tmp_path, progress_tx.clone(), cancel_token,+ let result = super::parallel_download::download_parallel(+ &client, &media, &tmp_path, progress_tx.clone(), cancel_token, 8,).await;match result {