Skip to content

Commit 93eb19f

Browse files
committed
fix
1 parent 2bac43c commit 93eb19f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/tools/video_tools.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,11 @@ impl VideoCommandBuilder {
456456
tokio::fs::create_dir(&extract_path);
457457
tools::compression::unpack_tar_xz(&path, PathBuf::from(&extract_path)).await?;
458458
let root_folder = tokio::fs::read_dir(&extract_path).await?.next_entry().await?.ok_or::<RsError>("Unable to decompress".into())?;
459-
root_folder.push("bin");
460-
let mut path_ffmpeg = root_folder.path();
459+
let mut bin_folder = root_folder.path();
460+
bin_folder.push("bin");
461+
let mut path_ffmpeg = bin_folder.path();
461462
path_ffmpeg.push("ffmpeg");
462-
let mut path_ffprobe = root_folder.path();
463+
let mut path_ffprobe = bin_folder.path();
463464
path_ffprobe.push("ffprobe");
464465
println!("full path: {:?}", path_ffmpeg);
465466

@@ -483,6 +484,9 @@ impl VideoCommandBuilder {
483484
// Apply the new permissions
484485
std::fs::set_permissions(&ffprobe_target, perms)?;
485486

487+
tokio::fs::remove_file(path).await;
488+
tokio::fs::remove_dir_all(root_folder).await;
489+
486490
Ok(())
487491
}
488492

0 commit comments

Comments
 (0)