Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

DR3: raea check's report turns an issue's second into its frame without a closure of its own (tools/dupes.sh)

shinyobjectz2c111623c748
diff --git a/apps/check/src/lib.rs b/apps/check/src/lib.rs
index 54e66f5a..b34f27e9 100644
--- a/apps/check/src/lib.rs
+++ b/apps/check/src/lib.rs
@@ -153,8 +153,23 @@ fn run(args: &[String], tastes: Vec<raea_core_brief::Taste>) -> R<(String, bool)
/// text with the count last. True when an error is among them.
fn report(video: &str, mut issues: Vec<Issue>, more: Vec<Finding>, passed: Vec<String>, out: Option<&str>, fps: f64) -> R<(String, bool)> {
issues.sort_by(|a, b| a.p.cmp(&b.p).then(a.at.unwrap_or(0.0).total_cmp(&b.at.unwrap_or(0.0))));
- let at = |t: f64| (t * fps).round() as i64;
- let found = finding::ranked(issues.iter().map(|i| Finding::new(i.rule, Level::of_rank(i.p), &i.says, "raea check")).zip(&issues).map(|(f, i)| if let Some(t) = i.at { f.frames(at(t), at(t) + 1) } else { f }).chain(more).collect());
+ let found = finding::ranked(
+ issues
+ .iter()
+ .map(|i| {
+ let f = Finding::new(i.rule, Level::of_rank(i.p), &i.says, "raea check");
+ // an issue at a second is about the frame it falls on
+ match i.at {
+ Some(t) => {
+ let fr = (t * fps).round() as i64;
+ f.frames(fr, fr + 1)
+ }
+ None => f,
+ }
+ })
+ .chain(more)
+ .collect(),
+ );
let bad = found.iter().any(|f| f.level == Level::Error);
if let Some(out) = out {
let j = json!({"file": video, "fps": fps, "findings": found, "passed": passed});