fix download path

This commit is contained in:
Quaternions 2024-01-14 18:43:03 -08:00
parent d6add611fb
commit cbb5805d54

View File

@ -445,7 +445,8 @@ async fn download_history(mut config:DownloadHistoryConfig)->AResult<()>{
let client=client.clone(); let client=client.clone();
let cookie=cookie.clone(); let cookie=cookie.clone();
let asset_id_str=asset_id_str.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{ 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 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?))?{ 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)?, 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?; tokio::fs::write(path,contents).await?;
Ok::<_,anyhow::Error>(()) Ok::<_,anyhow::Error>(())