summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-16 22:14:26 +0300
committerPaul Buetow <paul@buetow.org>2026-06-16 22:14:26 +0300
commitaca23d3a094cb1bf86db40e42f184fbf88371d42 (patch)
treed749f7c75982b3290d21f36f67e9769e0c5402ce /bin
parentfe59a701586972793ea110b465f65d47b825fb8e (diff)
cn0 split stats.source.sh into aggregate/render/filter-album modules
Pure code move: split the ~1248-line stats.source.sh (SRP+SoC) into three cohesive modules, all functions and STATS_* constants/globals moved verbatim: - stats-aggregate.source.sh: EXIF parsing, bucketing, _stats_tally, reset/collect_photo_exif_stats and the STATS_* maps. - stats-render.source.sh: stats overview page (sections, bars, leaderboard, render_stats_page, _stats_build_body, _stats_filter_link, background pickers). - stats-filter-album.source.sh: per-filter mini-albums (render_filter_pages, gallery/view/thumbnail builders, _stats_enqueue_filter_album). Updated LIB_SOURCES accordingly. No logic change (verified: all 55 functions and top-level globals preserved; full suite, shellcheck, check-generated, diff all pass). The SoC point (HTML built in bash rather than templates) is left for a follow-up (nn0/qn0). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/shuriken21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/shuriken b/bin/shuriken
index 729e693..49d49a6 100755
--- a/bin/shuriken
+++ b/bin/shuriken
@@ -3084,7 +3084,7 @@ refresh_splash() {
log_info "Refreshed splash page $(_display_path "$DIST_DIR/index.html")"
}
-# Inlined from src/lib/stats.source.sh
+# Inlined from src/lib/stats-aggregate.source.sh
# Stats aggregation for the album stats page (feature plan:
# /home/paul/.pi/plans/shuriken-stats-site.md, field audit:
# docs/stats-exif-audit.md). This module turns the per-photo
@@ -3688,6 +3688,16 @@ collect_photo_exif_stats() {
done < <(incoming_image_files)
}
+# Inlined from src/lib/stats-render.source.sh
+# Stats overview page rendering. Split out of stats.source.sh (task cn0) so the
+# HTML/layout concern lives apart from the EXIF aggregation/bucketing (now in
+# stats-aggregate.source.sh) and the per-filter mini-albums (now in
+# stats-filter-album.source.sh). This module reads the STATS_* globals filled by
+# collect_photo_exif_stats and turns them into the static stats overview page
+# (bar charts, sections, camera leaderboard). All libs are sourced before run,
+# so the STATS_* maps and the STATS_*_DIR constants defined in the sibling
+# modules are available here at runtime.
+
# ----------------------------------------------------------------------------
# Rendering (task pm0)
# ----------------------------------------------------------------------------
@@ -4076,6 +4086,15 @@ render_stats_page() {
tarball_name ''
}
+# Inlined from src/lib/stats-filter-album.source.sh
+# Per-filter mini-album page rendering. Split out of stats.source.sh (task cn0)
+# so this concern is separate from the EXIF aggregation (stats-aggregate.source.sh)
+# and the stats overview page (stats-render.source.sh). Every tallied bucket
+# becomes a clickable mini album under dist/stats/<pagebase>/. This module reads
+# the STATS_FILTER_* globals filled by collect_photo_exif_stats plus the
+# album-side ALBUM_VIEW_PAGE_BY_PHOTO map at runtime; all libs are sourced before
+# run so cross-module references resolve.
+
# ----------------------------------------------------------------------------
# Filter mini-album pages
# ----------------------------------------------------------------------------