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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user