Prevent data loss if concatenation failed (#353)

In some cases concatenation silently fails. To prevent loss of the
encoded data we now check if the output file exists. If it does not
exist we do not delete the temp folder.
This commit is contained in:
mxsrm 2021-09-03 23:43:16 +02:00 committed by GitHub
parent 9a95a00557
commit 0316a4c0ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1273,7 +1273,9 @@ impl Project {
plot_vmaf(&input, &output_file, model).unwrap();
}
if !keep {
if !Path::new(&output_file).exists() {
warn!("Concatenating failed for unknown reasons! Temp folder will not be deleted: {}", temp);
} else if !keep {
if let Err(e) = fs::remove_dir_all(temp) {
warn!("Failed to delete temp directory: {}", e);
}