diff --git a/crates/stream_pulse/src/lib/process_stream.rs b/crates/stream_pulse/src/lib/process_stream.rs index 38da369..e64f8fa 100644 --- a/crates/stream_pulse/src/lib/process_stream.rs +++ b/crates/stream_pulse/src/lib/process_stream.rs @@ -131,9 +131,11 @@ fn handle_stream_audio( // Skip download if .mp3 already exists if !audio_mp3_path.exists() { - if let Err(e) = ytdlp.download_audio(&youtube_stream, &audio_base_path) { - tracing::error!(error = ?e, "Failed to download video"); - bail!("Failed to download video: {:?}", e); + if let Err(e) = ytdlp + .download_audio(&youtube_stream, &audio_base_path) + .inspect_err(|e| tracing::error!(error = ?e, "Failed to download audio")) + { + bail!("Failed to download audio: {:?}", e); }; } else { tracing::debug!("Audio already exists at {:?}", audio_mp3_path); diff --git a/crates/ytdlp_bindings/build.rs b/crates/ytdlp_bindings/build.rs index 0d8c649..c5cdb5a 100644 --- a/crates/ytdlp_bindings/build.rs +++ b/crates/ytdlp_bindings/build.rs @@ -19,7 +19,7 @@ fn main() -> Result<(), Box> { ("linux", "x86_64" | "x86") => "yt-dlp_linux", ("linux", "aarch64") => "yt-dlp_linux_aarch64", ("linux", "arm") => "yt-dlp_linux_armv7I", - _ => return Err(format!("Unsupported platform: {} {}", target_os, target_arch).into()), + _ => return Err(format!("Unsupported platform: {target_os} {target_arch}").into()), }; // Create an output directory for the binary diff --git a/crates/ytdlp_bindings/src/processors/video.rs b/crates/ytdlp_bindings/src/processors/video.rs index 30d5455..3a3765f 100644 --- a/crates/ytdlp_bindings/src/processors/video.rs +++ b/crates/ytdlp_bindings/src/processors/video.rs @@ -6,7 +6,7 @@ use crate::{error::YtDlpError, YtDlp}; use std::path::Path; /// A trait for processing video files. -/// Requires `ffmpeg` v7* available in the evironment +/// Requires `ffmpeg` v7* available in the environment pub trait VideoProcessor { /// Converts a video to a different format. /// @@ -75,7 +75,7 @@ impl VideoProcessor for YtDlp { let output_str = output_template.as_ref().to_str().ok_or_else(|| { YtDlpError::InvalidPath(output_template.as_ref().display().to_string()) })?; - let fps = format!("fps={}", fps); + let fps = format!("fps={fps}"); let extra_args = extra_args.map(|args| args.join(" ")).unwrap_or_default(); // ffmpeg -i input_video.mp4 -vf fps=1/10 output_%04d.png