Directory holding pre-converted HEIC thumbnails, keyed by content hash
rather than file path, the same photo scanned into different databases
only needs converting once. Mirrors this project’s existing
~/.cache/ort/ convention for cached model weights.
Extracts the leading content hash from a cache filename (the .jpg
files this module writes, thumb_path, face_thumb_path,
original_path), or None if filename doesn’t match that shape.
Used by videre prune to find cache entries whose hash no longer has a
surviving file_hashes row, without hardcoding every suffix pattern this
module can produce. Deliberately does NOT match .tmp* scratch files
(see thumb_tmp_path/original_tmp_path), those may be actively being
written by a concurrently running videre watch, and reusing this same
hash-existence check against them could delete an in-flight write for a
hash that is still perfectly valid.
One-time migration from the pre-rename cache location. Thumbnails are
content-hash keyed and expensive to regenerate for large HEIC libraries,
so a rename of the tool should not orphan them. Only fires when the old
dir exists and the new one does not; a plain rename, so it is atomic on
the same filesystem and a no-op on any error (cache regenerates lazily).
Cache path for a full-resolution HEIC-converted original. One per hash
(not per face, the original photo is the same regardless of which face
on it was clicked).
Scratch path for writing a full-res original before it’s atomically
renamed into place at original_path, mirrors thumb_tmp_path’s
same-filesystem-atomic-rename pattern and process-id disambiguation.
Path to a scratch file for writing a thumbnail before it’s atomically
renamed into place at thumb_path. Lives in the same directory as the
final file so the rename is same-filesystem (and thus atomic on POSIX).
Includes the current process ID so concurrent writers (e.g. two
videre watch instances, or a leftover file from a crashed process) don’t
collide on the same temp name.