Compare commits
1 Commits
a48744c7ad
...
f50655fb21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f50655fb21 |
@@ -123,11 +123,7 @@ mod tests {
|
||||
"vacation/@eaDir/IMG_0001.jpg/SYNOFILE_THUMB_XL.jpg",
|
||||
"@eaDir/top_level_thumb.jpg",
|
||||
]);
|
||||
let found = enumerate_indexable_files(
|
||||
dir.path(),
|
||||
&["@eaDir".to_string()],
|
||||
None,
|
||||
);
|
||||
let found = enumerate_indexable_files(dir.path(), &["@eaDir".to_string()], None);
|
||||
assert_eq!(rel_paths(&found), vec!["vacation/IMG_0001.jpg".to_string()]);
|
||||
}
|
||||
|
||||
@@ -139,11 +135,7 @@ mod tests {
|
||||
"a/.thumbnails/cached.jpg",
|
||||
"a/b/.thumbnails/nested.jpg",
|
||||
]);
|
||||
let found = enumerate_indexable_files(
|
||||
dir.path(),
|
||||
&[".thumbnails".to_string()],
|
||||
None,
|
||||
);
|
||||
let found = enumerate_indexable_files(dir.path(), &[".thumbnails".to_string()], None);
|
||||
assert_eq!(rel_paths(&found), vec!["a/b/photo.jpg".to_string()]);
|
||||
}
|
||||
|
||||
@@ -151,15 +143,8 @@ mod tests {
|
||||
fn excludes_absolute_under_base() {
|
||||
// Leading-'/' entries are interpreted as paths under the library
|
||||
// root (see PathExcluder::new).
|
||||
let dir = make_tree(&[
|
||||
"private/secret.jpg",
|
||||
"public/keep.jpg",
|
||||
]);
|
||||
let found = enumerate_indexable_files(
|
||||
dir.path(),
|
||||
&["/private".to_string()],
|
||||
None,
|
||||
);
|
||||
let dir = make_tree(&["private/secret.jpg", "public/keep.jpg"]);
|
||||
let found = enumerate_indexable_files(dir.path(), &["/private".to_string()], None);
|
||||
assert_eq!(rel_paths(&found), vec!["public/keep.jpg".to_string()]);
|
||||
}
|
||||
|
||||
@@ -169,11 +154,14 @@ mod tests {
|
||||
"a.jpg",
|
||||
"b.mp4",
|
||||
"c.txt",
|
||||
"d", // no extension
|
||||
"e.jpg.bak", // wrong ext
|
||||
"d", // no extension
|
||||
"e.jpg.bak", // wrong ext
|
||||
]);
|
||||
let found = enumerate_indexable_files(dir.path(), &[], None);
|
||||
assert_eq!(rel_paths(&found), vec!["a.jpg".to_string(), "b.mp4".to_string()]);
|
||||
assert_eq!(
|
||||
rel_paths(&found),
|
||||
vec!["a.jpg".to_string(), "b.mp4".to_string()]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
19
src/main.rs
19
src/main.rs
@@ -2309,7 +2309,8 @@ fn backfill_unhashed_backlog(
|
||||
// library's tick. Negligible cost given the cap.
|
||||
let rows: Vec<(i32, String)> = {
|
||||
let mut dao = exif_dao.lock().expect("Unable to lock ExifDao");
|
||||
dao.get_rows_missing_hash(context, cap + 1).unwrap_or_default()
|
||||
dao.get_rows_missing_hash(context, cap + 1)
|
||||
.unwrap_or_default()
|
||||
};
|
||||
if rows.is_empty() {
|
||||
return 0;
|
||||
@@ -2335,9 +2336,13 @@ fn backfill_unhashed_backlog(
|
||||
match content_hash::compute(&abs) {
|
||||
Ok(id) => {
|
||||
let mut dao = exif_dao.lock().expect("Unable to lock ExifDao");
|
||||
if let Err(e) =
|
||||
dao.backfill_content_hash(context, library.id, rel_path, &id.content_hash, id.size_bytes)
|
||||
{
|
||||
if let Err(e) = dao.backfill_content_hash(
|
||||
context,
|
||||
library.id,
|
||||
rel_path,
|
||||
&id.content_hash,
|
||||
id.size_bytes,
|
||||
) {
|
||||
warn!(
|
||||
"face_watch: backfill_content_hash failed for {}: {:?}",
|
||||
rel_path, e
|
||||
@@ -2348,7 +2353,11 @@ fn backfill_unhashed_backlog(
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
debug!("face_watch: hash compute failed for {} ({:?})", abs.display(), e);
|
||||
debug!(
|
||||
"face_watch: hash compute failed for {} ({:?})",
|
||||
abs.display(),
|
||||
e
|
||||
);
|
||||
errors += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user