Skip to content

Commit 278e3db

Browse files
authored
fix(transcode): create transcode directory if it does not exist (#30)
1 parent dd48384 commit 278e3db

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/imdl/torrent.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ pub async fn create_torrent(
2525
if output.status.success() {
2626
Ok(())
2727
} else {
28-
Err(anyhow::anyhow!("Failed to create torrent"))
28+
let output_info = match String::from_utf8(output.stderr) {
29+
Ok(string) => string,
30+
Err(..) => "<failed to load command output>".to_string()
31+
};
32+
Err(anyhow::anyhow!(format!("Failed to create torrent: {}", output_info)))
2933
}
3034
}

src/transcode/transcode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub async fn transcode_release(
5252
}
5353
}
5454

55-
fs::create_dir(&output_dir).await?;
55+
fs::create_dir_all(&output_dir).await?;
5656

5757
let paths = get_all_files_with_extension(&flac_dir, ".flac").await?;
5858

0 commit comments

Comments
 (0)