chore: cargo fmt + clippy fix for collapsed if-let chain (T017)

- cargo fmt applied across all modified source files
- Collapse nested if let Some / if !is_empty into a single let-chain (clippy::collapsible_match)
- All other warnings are pre-existing dead-code lint on unused trait methods

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Cameron
2026-03-18 23:09:58 -04:00
parent 5c9f5c7d0b
commit c1b6013412
8 changed files with 201 additions and 160 deletions

View File

@@ -159,19 +159,21 @@ async fn get_video_rotation(video_path: &str) -> i32 {
.await;
if let Ok(output) = output
&& output.status.success() {
let rotation_str = String::from_utf8_lossy(&output.stdout);
let rotation_str = rotation_str.trim();
if !rotation_str.is_empty()
&& let Ok(rotation) = rotation_str.parse::<i32>()
&& rotation != 0 {
debug!(
"Detected rotation {}° from stream tag for {}",
rotation, video_path
);
return rotation;
}
&& output.status.success()
{
let rotation_str = String::from_utf8_lossy(&output.stdout);
let rotation_str = rotation_str.trim();
if !rotation_str.is_empty()
&& let Ok(rotation) = rotation_str.parse::<i32>()
&& rotation != 0
{
debug!(
"Detected rotation {}° from stream tag for {}",
rotation, video_path
);
return rotation;
}
}
// Check display matrix side data (modern videos, e.g. iPhone)
let output = tokio::process::Command::new("ffprobe")
@@ -188,21 +190,23 @@ async fn get_video_rotation(video_path: &str) -> i32 {
.await;
if let Ok(output) = output
&& output.status.success() {
let rotation_str = String::from_utf8_lossy(&output.stdout);
let rotation_str = rotation_str.trim();
if !rotation_str.is_empty()
&& let Ok(rotation) = rotation_str.parse::<f64>() {
let rotation = rotation.abs() as i32;
if rotation != 0 {
debug!(
"Detected rotation {}° from display matrix for {}",
rotation, video_path
);
return rotation;
}
}
&& output.status.success()
{
let rotation_str = String::from_utf8_lossy(&output.stdout);
let rotation_str = rotation_str.trim();
if !rotation_str.is_empty()
&& let Ok(rotation) = rotation_str.parse::<f64>()
{
let rotation = rotation.abs() as i32;
if rotation != 0 {
debug!(
"Detected rotation {}° from display matrix for {}",
rotation, video_path
);
return rotation;
}
}
}
0
}
@@ -550,7 +554,8 @@ impl Handler<GeneratePreviewClipMessage> for PreviewClipGenerator {
{
let otel_ctx = opentelemetry::Context::current();
let mut dao = preview_dao.lock().expect("Unable to lock PreviewDao");
let _ = dao.update_status(&otel_ctx, &relative_path, "processing", None, None, None);
let _ =
dao.update_status(&otel_ctx, &relative_path, "processing", None, None, None);
}
// Compute output path: join preview_clips_dir with relative path, change ext to .mp4