diff options
| author | Ken D'Ambrosio <ken@jots.org> | 2026-05-22 22:50:35 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@jots.org> | 2026-05-22 22:50:35 +0000 |
| commit | d32b5e99afc6f0cffefa594510cda0e4f414db75 (patch) | |
| tree | b4c24a1a7264bcbde72c0fff906e7bf380c18a02 /README.md | |
| parent | de80b9871ebe1497c672f3c7c7bb5467dabcb83a (diff) | |
Speed up update.rb and fix UI always forcing full rescan
- update.rb: skip exiftool on images marked exif_absent (set after first
failed attempt); prevents repeated slow scans of old photos with no EXIF
- update.rb: explicit directory argument now implies force — passing a path
always rescans that subtree regardless of sentinel mtime
- app.rb: /admin/update no longer hardcodes --force; sentinel-based skipping
is used by default, making UI updates finish in seconds instead of minutes
- admin/album.erb: add "Force rescan all" checkbox to Run Update button;
checked state passes force=1 to the server and restores --force behavior
- README.md, DESIGN.md: document sentinel skipping, exif_absent flag, and
explicit-directory force behavior
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -32,6 +32,8 @@ back end, plain HTML/CSS/JS front end. Live at **https://albumen.jots.org**. - Per-album: title, description, cover image (specific file or random), sub-album order, visibility - Per-file: caption, visibility - Save button at top and bottom of the edit form +- **Run Update** button scans for new/removed files and generates missing thumbnails; + **Force rescan all** checkbox bypasses the sentinel and rescans every directory ### Media support @@ -84,20 +86,29 @@ The update script walks the media tree, creates/updates `album.json` files with EXIF dates and image dimensions, and pre-generates thumbnails. ```bash -# On the server — process the entire tree +# On the server — process the entire tree (skips unchanged directories) ruby /opt/albumen/scripts/update.rb -# Process only one album (and its sub-albums) +# Process only one album (and its sub-albums) — always runs regardless of mtime ruby /opt/albumen/scripts/update.rb 2024-Italy # With an absolute path ruby /opt/albumen/scripts/update.rb /var/albumen/2024-Italy + +# Force a full rescan of everything, ignoring all change detection +ruby /opt/albumen/scripts/update.rb --force ``` **Resilience guarantees — safe to interrupt and re-run at any point:** - `album.json` is written atomically (temp file + rename); no partial writes. +- Unchanged directories are skipped via a `.albumen_scanned` sentinel file — + a global run with nothing new typically completes in under a second. +- Providing an explicit directory bypasses the sentinel for that subtree, so + `update.rb some-album` always rescans that album even if nothing appears changed. - Thumbnails that already exist are skipped entirely. - EXIF metadata already recorded is not re-extracted. +- Images with no EXIF data are marked `exif_absent` after the first attempt so + exiftool is not re-invoked on them in subsequent rescans. - Deleted files are pruned from `album.json` automatically. Typical workflow: |
