summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-14 23:21:41 +0300
committerPaul Buetow <paul@buetow.org>2026-06-14 23:21:41 +0300
commit840585ffc6f879b3e48e508a36da10471025e142 (patch)
treeb36fefca97f96b42da326c50ef2ea33a7ed17071 /src/lib
parentb7d5c1102c3679b67532f30f2613e4d2d61c59ba (diff)
rm0 surface stats page in the dry-run plan
Review follow-up: collect_dry_run_plan stored plan["stats_page"] but print_dry_run_plan never rendered it, so --dry-run gave no signal about the STATS_PAGE toggle or the stats/camera pages generate() would write (dead assignment, breaking parity with splash_page). Print a "Stats page: <yes|no>" line and, when enabled, list stats.html and camera-*.html under "Planned generated files" (camera pages are a wildcard since dry-run does not run EXIF aggregation). Add a --dry-run --no-stats test asserting the stats plan is omitted, and extend the existing dry-run test to assert the stats lines when enabled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/album.source.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/album.source.sh b/src/lib/album.source.sh
index c9812a2..57727d3 100644
--- a/src/lib/album.source.sh
+++ b/src/lib/album.source.sh
@@ -1204,6 +1204,7 @@ print_dry_run_plan() {
printf 'Random seed: %s\n' "${plan_ref["random_seed"]}"
printf 'Shuffle: %s\n' "${plan_ref["shuffle"]}"
printf 'Splash page: %s\n' "${plan_ref["splash_page"]}"
+ printf 'Stats page: %s\n' "${plan_ref["stats_page"]}"
printf 'Image count: %s\n' "${plan_ref["image_count"]}"
printf 'Tarball setting: %s\n' "${plan_ref["tarball_include"]}"
printf 'Tarball name plan: %s\n' "${plan_ref["tarball_name_plan"]}"
@@ -1238,6 +1239,13 @@ print_dry_run_plan() {
"${plan_ref["dist_dir"]}" "${plan_ref["details_count"]}"
printf ' %s/[redirect].html (%s navigation redirects)\n' \
"${plan_ref["dist_dir"]}" "${plan_ref["redirect_count"]}"
+ if [ "${plan_ref["stats_page"]}" = yes ]; then
+ # The exact camera-page count needs EXIF aggregation, which dry-run
+ # does not perform, so list them as a wildcard.
+ printf ' %s/stats.html (EXIF stats page)\n' "${plan_ref["dist_dir"]}"
+ printf ' %s/camera-*.html (per-camera pages)\n' \
+ "${plan_ref["dist_dir"]}"
+ fi
if [ "${plan_ref["tarball_include"]}" = yes ]; then
printf ' %s/%s\n' \
"${plan_ref["dist_dir"]}" "${plan_ref["tarball_name_plan"]}"