Added functionality to clean up transcoded source files
This commit is contained in:
@ -47,9 +47,9 @@ impl Repository {
|
||||
return ingest_files;
|
||||
}
|
||||
|
||||
pub fn archive_file(&self, file: String) {
|
||||
let ingest_file = Path::new(&self.ingest_dir).join(&file);
|
||||
let archive_file = Path::new(&self.archive_dir).join(&file);
|
||||
pub fn archive_file(&self, file: &str) {
|
||||
let ingest_file = Path::new(&self.ingest_dir).join(file);
|
||||
let archive_file = Path::new(&self.archive_dir).join(file);
|
||||
|
||||
match fs::copy(&ingest_file, &archive_file) {
|
||||
Ok(_) => {
|
||||
@ -61,6 +61,12 @@ impl Repository {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cleanup_file(&self, file: &str) {
|
||||
let ingest_file = Path::new(&self.ingest_dir).join(file);
|
||||
fs::remove_file(&ingest_file)
|
||||
.expect("File deletion failed.");
|
||||
}
|
||||
}
|
||||
|
||||
fn create_directory(path: &str) {
|
||||
|
Reference in New Issue
Block a user