Used the config-rs crate to allow reading from a config file from /etc/zealot/config.toml and from the home directory
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2022-09-15 18:10:42 -04:00
parent 0b6fb8a4f8
commit 024e4b2e1c
5 changed files with 25 additions and 46 deletions

View File

@@ -3,7 +3,7 @@ use config::Config;
use transcoder::repository::Repository;
use transcoder::transcoder::Transcoder;
mod config;
mod settings;
mod transcoder;
mod util;
@@ -12,8 +12,8 @@ fn main() {
log4rs::init_file("./log4rs.yaml", Default::default()).unwrap();
// create and initialize our config and repository objects
let c: Config = Config::new("~/.config/zealot.toml");
let r: Repository = Repository::new(&c.get_repository());
let c: Config = settings::load_config();
let r: Repository = Repository::new(&shellexpand::tilde(&c.get_string("transcoder.repository").unwrap()));
// create and start the video transcoder object
let t: Transcoder = Transcoder::new(c, r);