Zealot/src/transcoder.rs

35 lines
682 B
Rust
Raw Normal View History

2022-08-31 16:14:41 -04:00
use crate::config::Config;
use crate::repository::Repository;
pub struct Transcoder {
config: Config,
repository: Repository,
}
impl Transcoder {
pub fn new(config: Config, repository: Repository) -> Transcoder {
return Transcoder{
config: config,
repository: repository,
}
}
pub fn start(self) {
println!("Starting transcoder...");
// search for files in ingest
let ingest_files = self.repository.search_ingest();
for i in ingest_files {
// copy the file to the archive
self.repository.archive_file(&i);
// perform the video transcode
// TODO - self.transcode(i);
// remove the source file
self.repository.cleanup_file(&i);
}
2022-08-31 16:14:41 -04:00
}
}