From cbb5805d54339c6b7f16a9c078ac78b6f9d818ce Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sun, 14 Jan 2024 18:43:03 -0800 Subject: [PATCH] fix download path --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index e365bb9..c3a8ee0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -445,7 +445,8 @@ async fn download_history(mut config:DownloadHistoryConfig)->AResult<()>{ let client=client.clone(); let cookie=cookie.clone(); let asset_id_str=asset_id_str.clone(); - let output_folder=output_folder.clone(); + let mut path=output_folder.clone(); + path.push(format!("{}_v{}.rbxl",config.asset_id,version_number)); join_set.spawn(async move{ let resp=download_asset_version(&client,cookie.as_str(),asset_id_str.as_str(),version_number.to_string().as_str()).await?; let contents=match maybe_gzip_decode(std::io::Cursor::new(resp.bytes().await?))?{ @@ -453,9 +454,6 @@ async fn download_history(mut config:DownloadHistoryConfig)->AResult<()>{ ReaderType::Raw(readable)=>read_readable(readable)?, }; - let mut path=output_folder.clone(); - path.set_file_name(format!("{}_v{}.rbxl",config.asset_id,version_number)); - tokio::fs::write(path,contents).await?; Ok::<_,anyhow::Error>(())