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(()) }