feat: add --review flag with browser-based side-by-side image review

- Launches local HTTP server with dark-themed review UI
- Side-by-side image comparison per duplicate group
- Checkbox selection + delete confirmation
- Shows file size and path per image
- Exact/similar badges per group
- Shutdown endpoint for clean exit
- Magic byte format detection (fixes misnamed screenshots)
- 23 tests passing
This commit is contained in:
admin
2026-04-28 00:08:33 +00:00
parent 9dc8a495bb
commit bb04871383
5 changed files with 451 additions and 18 deletions

View File

@@ -146,3 +146,16 @@ fn misnamed_jpeg_as_png_still_scanned() {
let fake = fake.unwrap();
assert_eq!(orig.sha256, fake.sha256, "same content = same sha256");
}
#[test]
fn cli_review_flag_accepted_no_dupes() {
let bin = env!("CARGO_BIN_EXE_deduper");
let output = std::process::Command::new(bin)
.arg("/a0/usr/projects/deduper/.a0proj/test_media/images/empty_dir")
.arg("--review")
.output()
.expect("failed to run deduper binary");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(output.status.success(), "--review on empty dir should exit 0: {}", String::from_utf8_lossy(&output.stderr));
assert!(stdout.contains("no image duplicates found"), "should report no dupes: {stdout}");
}