fix(config): made ffmpeg config section more optional
This commit is contained in:
parent
05848b6701
commit
f68806d814
4 changed files with 5 additions and 5 deletions
|
@ -28,7 +28,7 @@ pub struct ConfigFFmpegOutput {
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct ConfigFFmpeg {
|
||||
pub path: String,
|
||||
pub path: Option<String>,
|
||||
pub extra_args: Option<Vec<String>>,
|
||||
pub overwrite: Option<bool>,
|
||||
pub process: Option<ConfigFFmpegProcess>,
|
||||
|
|
|
@ -54,7 +54,7 @@ impl Config {
|
|||
cleanup: None,
|
||||
},
|
||||
ffmpeg: ffmpeg::ConfigFFmpeg {
|
||||
path: String::from("/usr/bin/ffmpeg"),
|
||||
path: Some(String::from("/usr/bin/ffmpeg")),
|
||||
extra_args: None,
|
||||
overwrite: None,
|
||||
process: Some(ffmpeg::ConfigFFmpegProcess {
|
||||
|
|
|
@ -66,8 +66,8 @@ impl FFmpegCommandOptions {
|
|||
args
|
||||
}
|
||||
|
||||
pub fn to_command(&self, ffmpeg_path: &str) -> Command {
|
||||
let mut command = Command::new(ffmpeg_path);
|
||||
pub fn to_command<S: Into<String>>(&self, ffmpeg_path: S) -> Command {
|
||||
let mut command = Command::new(ffmpeg_path.into());
|
||||
command.args(self.to_args());
|
||||
command
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ impl TranscodeJob {
|
|||
pub fn build_command(&self, ffmpeg_config: &ConfigFFmpeg) -> Command {
|
||||
ffmpeg_config
|
||||
.build_command_options(&self.input, &self.output)
|
||||
.to_command(&ffmpeg_config.path)
|
||||
.to_command(&ffmpeg_config.path.clone().unwrap_or("ffmpeg".to_string()))
|
||||
}
|
||||
|
||||
pub fn check_if_exists(&self) -> bool {
|
||||
|
|
Loading…
Reference in a new issue