fix(capture): populate contentHash on captured samples to fix always-prompting remove

contentHash was left empty on every capture; hashReferencedElsewhere returns
false for empty hashes, so every remove looked like a last reference. Add
FNV-1a hashBytes to capture_paths, wire into both commit paths. NOTE: this
activates index dedup-by-hash in production — a bit-identical re-capture now
collapses onto the existing entry instead of adding a duplicate (spec-intended).
This commit is contained in:
2026-07-26 16:37:46 -04:00
parent 791a9c60eb
commit 5fabade90c
6 changed files with 133 additions and 5 deletions
+4 -1
View File
@@ -52,7 +52,10 @@ Sample sampleFromRecordedCapture(const RecordedCapture& cap) {
s.lengthSeconds = cap.endSeconds - cap.startSeconds;
s.captureTempo = cap.captureTempo;
s.tier = Tier::Scratch; // captures land in scratch by default
// contentHash left empty: empty hashes do not participate in dedup (bank_model).
// contentHash set by the caller (capture_realtime.cpp) after the file is
// finalized and on disk — the hash is over the finished file bytes. Left empty
// here because sampleFromRecordedCapture runs before the file exists (the
// mapping is pure / DAW-free); the shell patches it in after the move+trim.
s.createdTimestamp = cap.createdTimestamp;
return s;
}