From 6697431d3855d3030b35c2ce232c9ea0e9282ba7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 24 Jun 2026 10:45:28 +0300 Subject: Split album-metadata.source.sh into focused modules (6r0) album-metadata.source.sh aggregated six unrelated concerns. Move each along its existing seam (pure mechanical move, no logic changes): - EXIF presentation (photo_exif_details_html, tooltip helpers, the _photo_exif_values_to wrapper) stays in album-metadata.source.sh, which is now EXIF-presentation only. - File counting (count_files, count_incoming_images, count_tree_files) -> image.source.sh, which already owns incoming_image_files; count_incoming_images is a direct wrapper of it. - Tarball naming (tarball_name_plan, generated_tarball_name) -> archive.source.sh, which already owns tarball()/resolve_tar_opts. - Generation metadata + JSON (_collect_generation_metadata, _generation_metadata_json, write_generation_metadata) -> new generation-metadata.source.sh. - Dry-run (dry_run, collect_dry_run_*, print_dry_run_plan) -> new dry-run.source.sh. - clear_exif_cache -> metadata-cache.source.sh, next to the cache primitive cached_photo_identify_output. LIB_SOURCES (Justfile + src/shuriken.sh): insert generation-metadata and dry-run right after album-metadata, before album-render/album. They depend on image, archive, template and metadata-cache (all earlier or runtime-only calls), and are consumed by the album coordinator and the dry-run CLI action, which come later. bin/shuriken regenerated via just build. File-header comments updated to reflect the new homes. just test, just shellcheck, just check-generated and git diff --check all pass. Co-Authored-By: Claude Opus 4.8 --- src/lib/metadata-cache.source.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib/metadata-cache.source.sh') diff --git a/src/lib/metadata-cache.source.sh b/src/lib/metadata-cache.source.sh index ba40ca9..7c6d2e3 100644 --- a/src/lib/metadata-cache.source.sh +++ b/src/lib/metadata-cache.source.sh @@ -140,3 +140,16 @@ photo_exif_values_to() { fi done } + +# Empty the volatile EXIF cache (./cache/exif, parallel to ./dist) so a --force +# run re-runs `identify` from scratch. Done once up front; the cache then +# repopulates and is reused for the rest of the run (one identify per photo). +# Moved here from album-metadata.source.sh (task 6r0): clearing the cache is the +# lifecycle counterpart of cached_photo_identify_output above, so the cache's +# creation and destruction now live in the same module. +clear_exif_cache() { + local -r cache_dir="$(dirname "$DIST_DIR")/cache/exif" + + log_verbose "Force generation; clearing EXIF cache $cache_dir" + rm -rf "$cache_dir" +} -- cgit v1.2.3