Build insight title from generated summary

This commit is contained in:
Cameron
2026-02-24 16:08:25 -05:00
parent 1fb3441a38
commit 7a0da1ab4a
6 changed files with 63 additions and 150 deletions

View File

@@ -156,20 +156,20 @@ async fn get_video_rotation(video_path: &str) -> i32 {
.output()
.await;
if let Ok(output) = output {
if output.status.success() {
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() {
if let Ok(rotation) = rotation_str.parse::<i32>() {
if rotation != 0 {
debug!("Detected rotation {}° from stream tag for {}", rotation, video_path);
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")
@@ -185,21 +185,22 @@ async fn get_video_rotation(video_path: &str) -> i32 {
.output()
.await;
if let Ok(output) = output {
if output.status.success() {
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() {
if let Ok(rotation) = rotation_str.parse::<f64>() {
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);
debug!(
"Detected rotation {}° from display matrix for {}",
rotation, video_path
);
return rotation;
}
}
}
}
}
0
}