feat: Update All albums button + fast, accurate index scans#342
Merged
Conversation
Album Management gains an "Update All" button that updates every album's index, pipelined two at a time (backend semaphores serialize the GPU and disk-heavy stages, so one album scans/UMAPs while another encodes). The queue polls the backend directly, so it survives closing and reopening the dialog; the button label shows live progress and hides when no albums exist. Index scans are reworked around the min_image_dimension gate from #269, whose per-file header open made update scans crawl (~190ms/file over NFS): - Scans traverse by extension only and dimension-probe just the files not already indexed; a scan_rejects.npz sidecar remembers rejected files by size/mtime so they are dismissed on a stat alone in later scans. - The gate gains byte-size bands, sampled from a real 122k-file library: files over 500KB pass without opening (0/1175 sampled failures) and files under a new per-album min_image_bytes floor (default 8KB, measured 0.15% false negatives) are rejected without opening. The floor is edited next to the pixel gate in the album editor ("[8] kb [256] pixels"); 0 disables. - Traversal prunes hidden directories and known thumbnail caches (@eadir, __MACOSX, photomap_index). Shotwell's 360px thumbs pass both gates, so only pruning keeps them out of the index. - A process-wide scan semaphore stops concurrent album scans from thrashing disk seeks and the GIL. - The "Checking new image files" phase drives a real progress bar (its total is known up front) instead of a static message. The album card's "Index updated <when>" timestamp now reports when an update operation last completed (a last_updated marker file) rather than the .npz mtime, so a no-change update no longer looks stale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"Update All" button in Album Management updates every album's index, two at a time. Backend semaphores serialize the GPU-encoding and file-scan stages across albums, so the pipeline overlaps one album's scan/UMAP with another's encoding without contention. The queue tracks completion by polling the backend directly, so it keeps working through albums when the dialog is closed and repaints its live progress label ("Updating 2/7…") on reopen. Hidden when no albums exist; labels no longer word-wrap.
Scan performance rework around the
min_image_dimensiongate (fix(indexing): gate image indexing on pixel dimensions, not file bytes #269), whose per-file header open made scans crawl on large/NFS libraries (~190 ms/file measured):scan_rejects.npzsidecar remembers gate-rejected files by size/mtime, so previously rejected files (e.g. NAS thumbnails) are dismissed on a stat alone in every later scan. Invalidated automatically when either gate threshold changes.min_image_bytesfloor reject without opening (8 KB default = 0.15% measured false negatives vs. 49% at the pre-fix(indexing): gate image indexing on pixel dimensions, not file bytes #269 100 KB cutoff).@eaDir,__MACOSX,photomap_index). This is a correctness fix too: Shotwell's 360px thumbs (.shotwell/thumbs/thumbs360/) pass both gates and were being indexed as photos; existing entries self-heal (removed as "missing") on the next update.min_image_bytesis a per-album setting (bytes in YAML, edited in kb next to the pixel gate:[8] kb [256] pixels; 0 disables), threaded through config, routers, and the album editor."Index updated " on album cards now reports when an update operation last completed (via a
last_updatedmarker file) instead of the.npzmtime, so a no-change update no longer looks stale. The.npzmtime is untouched — it still drives the UMAP cache staleness check.Behavior notes
min_image_dimensionno longer purges now-too-small images on update (only on full rebuild), since updates no longer re-probe indexed files..picasaoriginals(a hidden dir) is now skipped by the hidden-dir rule; its contents are pre-edit duplicates of edited photos.Test plan
min_image_bytesAPI round-trip, last-updated timestamp advancing on a no-change update.🤖 Generated with Claude Code