Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Cache Cargo
uses: actions/cache@v4
Expand All @@ -76,3 +78,9 @@ jobs:

- name: Check ${{ matrix.crate }}
run: cargo check --manifest-path ${{ matrix.crate }}/Cargo.toml

- name: Clippy ${{ matrix.crate }}
run: cargo clippy --manifest-path ${{ matrix.crate }}/Cargo.toml --all-targets -- -D warnings

- name: Test ${{ matrix.crate }}
run: cargo test --manifest-path ${{ matrix.crate }}/Cargo.toml --all-targets
1 change: 1 addition & 0 deletions render/src/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub struct SegmentWriter {
}

impl SegmentWriter {
#[allow(clippy::too_many_arguments)]
pub async fn new(
output_path: &str,
width: u32,
Expand Down
31 changes: 14 additions & 17 deletions render/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ fn resolve_chromium_executable() -> Option<PathBuf> {
.filter(|value| !value.is_empty())
.map(PathBuf::from);

if let Some(path) = path {
if path.is_file() {
return Some(path);
}
if let Some(path) = path
&& path.is_file()
{
return Some(path);
}
None
})
Expand Down Expand Up @@ -673,19 +673,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let audio_plan_url = std::env::var("RENDER_AUDIO_PLAN_URL")
.unwrap_or_else(|_| backend_endpoint("render_audio_plan"));
let audio_plan_client = Client::new();
if let Ok(resp) = backend_get(&audio_plan_client, &audio_plan_url).await {
if resp.status().is_success() {
if let Ok(plan) = resp.json::<AudioPlanResolved>().await {
if !plan.segments.is_empty() {
let input_video = working_output.clone();
let temp_video = frame_directory.join("output.audio.mp4");
mux_audio_plan_into_mp4(&input_video, &temp_video, &plan, total_frames, fps)
.await?;
tokio::fs::remove_file(&input_video).await.ok();
tokio::fs::rename(&temp_video, &input_video).await?;
}
}
}
if let Ok(resp) = backend_get(&audio_plan_client, &audio_plan_url).await
&& resp.status().is_success()
&& let Ok(plan) = resp.json::<AudioPlanResolved>().await
&& !plan.segments.is_empty()
{
let input_video = working_output.clone();
let temp_video = frame_directory.join("output.audio.mp4");
mux_audio_plan_into_mp4(&input_video, &temp_video, &plan, total_frames, fps).await?;
tokio::fs::remove_file(&input_video).await.ok();
tokio::fs::rename(&temp_video, &input_video).await?;
}

if is_canceled.load(Ordering::Relaxed) {
Expand Down
Loading