From 05c3e411f608f5b5f0b5efb639c00b478ce2d9a6 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 16 Aug 2024 18:45:28 -0700 Subject: [PATCH] ok --- src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 568721c..c9b3ce5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -704,7 +704,7 @@ async fn create_asset_medias(config:CreateAssetMediasConfig)->AResult<()>{ let context=CloudContext::new(config.api_key); let cookie_context=CookieContext::new(config.cookie); let expected_price=Some(config.expected_price.unwrap_or(0)); - futures::stream::iter(config.input_files.into_iter() + let asset_id_list=futures::stream::iter(config.input_files.into_iter() //step 1: read file, make create request .map(|path|{ let description=&config.description; @@ -772,18 +772,21 @@ async fn create_asset_medias(config:CreateAssetMediasConfig)->AResult<()>{ *dom.root().children().first().ok_or(DownloadDecalError::NoFirstInstance)? ).ok_or(DownloadDecalError::NoFirstInstance)?; match instance.properties.get("Texture").ok_or(DownloadDecalError::NoTextureProperty)?{ - rbx_dom_weak::types::Variant::String(s)=>Ok(s.clone()), + rbx_dom_weak::types::Variant::Content(url)=>Ok(url.clone().into_string()), _=>Err(DownloadDecalError::TexturePropertyInvalid), } }.await{ - Ok(yeah)=>Some(yeah), + Ok(asset_url)=>Some((asset_response.displayName,asset_url)), Err(e)=>{ eprintln!("get_asset error: {}",e); None }, } } - }); + }).collect::>().await; + for (file_name,asset_url) in asset_id_list{ + println!("{}={}",file_name,asset_url); + } Ok(()) }