v 0.1.1
This commit is contained in:
@@ -90,22 +90,32 @@ pub struct Template {
|
||||
pub output_ext: String,
|
||||
}
|
||||
|
||||
impl Default for Template {
|
||||
fn default() -> Self {
|
||||
impl Template {
|
||||
pub fn double(
|
||||
src: String,
|
||||
composition: String,
|
||||
output_module: String,
|
||||
output_ext: String,
|
||||
) -> Self {
|
||||
Self {
|
||||
src: "file:///c:/users/virtVmix-2/Downloads/PackShot_DOUBLE.aepx".to_string(),
|
||||
composition: "pack".to_string(),
|
||||
output_module: "Start_h264".to_string(),
|
||||
output_ext: "mp4".to_string(),
|
||||
src,
|
||||
composition,
|
||||
output_module,
|
||||
output_ext,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Template {
|
||||
pub fn single() -> Self {
|
||||
pub fn single(
|
||||
src: String,
|
||||
composition: String,
|
||||
output_module: String,
|
||||
output_ext: String,
|
||||
) -> Self {
|
||||
Self {
|
||||
src: "file:///c:/users/virtVmix-2/Downloads/PackShot_SINGLE.aepx".to_string(),
|
||||
..Default::default()
|
||||
src,
|
||||
composition,
|
||||
output_module,
|
||||
output_ext,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,17 +302,32 @@ impl JobData {
|
||||
variants
|
||||
}
|
||||
|
||||
pub fn to_nexrender_job(&self, output_folder: &str) -> NexrenderJob {
|
||||
// ЕДИНСТВЕННАЯ реализация метода
|
||||
pub fn to_nexrender_job(&self, config: &crate::config::Config) -> NexrenderJob {
|
||||
let template = if self.team_b.is_empty() {
|
||||
Template::single()
|
||||
Template::single(
|
||||
config.template_single_src.clone(),
|
||||
config.template_composition.clone(),
|
||||
config.template_output_module.clone(),
|
||||
config.template_output_ext.clone(),
|
||||
)
|
||||
} else {
|
||||
Template::default()
|
||||
Template::double(
|
||||
config.template_double_src.clone(),
|
||||
config.template_composition.clone(),
|
||||
config.template_output_module.clone(),
|
||||
config.template_output_ext.clone(),
|
||||
)
|
||||
};
|
||||
|
||||
let output_path = format!("{}/{}.mp4", output_folder, self.outfile_name);
|
||||
let output_path = format!(
|
||||
"{}/{}.{}",
|
||||
config.output_folder, self.outfile_name, config.template_output_ext
|
||||
);
|
||||
|
||||
let mut actions = Actions::default();
|
||||
actions.postrender.push(PostrenderAction::Copy {
|
||||
input: "encoded.mp4".to_string(),
|
||||
input: format!("encoded.{}", config.template_output_ext),
|
||||
output: output_path,
|
||||
});
|
||||
|
||||
@@ -503,16 +528,16 @@ impl LogoRegistry {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, team: String, sport: String, link: String) {
|
||||
self.logos.insert((team, sport), link);
|
||||
}
|
||||
|
||||
pub fn with_capacity(capacity: usize) -> Self {
|
||||
Self {
|
||||
logos: HashMap::with_capacity(capacity),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, team: String, sport: String, link: String) {
|
||||
self.logos.insert((team, sport), link);
|
||||
}
|
||||
|
||||
pub fn find(&self, team: &str, sport: &str) -> Option<String> {
|
||||
if let Some(link) = self.logos.get(&(team.to_string(), sport.to_string())) {
|
||||
return Some(link.clone());
|
||||
|
||||
Reference in New Issue
Block a user