feature/face-stats-exclude-videos #64

Merged
cameron merged 2 commits from feature/face-stats-exclude-videos into master 2026-04-30 21:17:20 +00:00
2 changed files with 20 additions and 8 deletions
Showing only changes of commit 67abd8d8ff - Show all commits

View File

@@ -383,7 +383,10 @@ mod tests {
// body cap and rejected normal-size photos before they reached // body cap and rejected normal-size photos before they reached
// the backend. // the backend.
assert!(is_transient(&classify_error_response(408, ""))); assert!(is_transient(&classify_error_response(408, "")));
assert!(is_transient(&classify_error_response(413, "<html>nginx</html>"))); assert!(is_transient(&classify_error_response(
413,
"<html>nginx</html>"
)));
assert!(is_transient(&classify_error_response(429, "{}"))); assert!(is_transient(&classify_error_response(429, "{}")));
} }

View File

@@ -1253,20 +1253,29 @@ mod tests {
// Seed: two paths tagged, one path untagged. // Seed: two paths tagged, one path untagged.
dao.tagged_photos.borrow_mut().insert( dao.tagged_photos.borrow_mut().insert(
"a.jpg".into(), "a.jpg".into(),
vec![Tag { id: 1, name: "alpha".into(), created_time: 0 }], vec![Tag {
id: 1,
name: "alpha".into(),
created_time: 0,
}],
); );
dao.tagged_photos.borrow_mut().insert( dao.tagged_photos.borrow_mut().insert(
"b.jpg".into(), "b.jpg".into(),
vec![ vec![
Tag { id: 2, name: "beta".into(), created_time: 0 }, Tag {
Tag { id: 3, name: "gamma".into(), created_time: 0 }, id: 2,
name: "beta".into(),
created_time: 0,
},
Tag {
id: 3,
name: "gamma".into(),
created_time: 0,
},
], ],
); );
let grouped = dao let grouped = dao
.get_tags_grouped_by_paths( .get_tags_grouped_by_paths(&ctx, &["a.jpg".into(), "b.jpg".into(), "c.jpg".into()])
&ctx,
&["a.jpg".into(), "b.jpg".into(), "c.jpg".into()],
)
.unwrap(); .unwrap();
assert_eq!(grouped.get("a.jpg").map(|v| v.len()), Some(1)); assert_eq!(grouped.get("a.jpg").map(|v| v.len()), Some(1));
assert_eq!(grouped.get("b.jpg").map(|v| v.len()), Some(2)); assert_eq!(grouped.get("b.jpg").map(|v| v.len()), Some(2));