diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-15 15:02:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-15 23:50:40 +0300 |
| commit | 79a002a21a27c7616261ae0c2cc8341e0ab92faa (patch) | |
| tree | b17547610606c8a88366581ccf437d96e407eb94 /src/lib/album.source.sh | |
| parent | be6ae2c9541a01927616b46cf6a683d7ce4519ff (diff) | |
Make every stat bucket a clickable filter mini-album, rendered in parallel
Generalises the per-camera mini-albums to every stats category: clicking any
row on the stats page (camera, lens, year, month, aperture, shutter, ISO, focal
length, megapixels, aspect, orientation, format, exposure program, metering,
white balance, flash) now opens a filter mini-album of just the matching photos,
with view pages whose prev/next cycle within the filter.
Aggregation: a single _stats_tally now records, for every tallied bucket, the
bucket's photo list and a unique filename-safe "pagebase" (camera-canon-eos-r5,
iso-400, year-2023, ...) with collision resolution, exposed via STATS_FILTER_*
maps. The old camera-only STATS_CAMERA_SLUGS/PHOTOS/SLUG_OWNERS are gone.
Render: every bar/leaderboard row is wrapped in a link to its bucket's pagebase
via _stats_filter_link. render_filter_pages replaces render_camera_pages and
renders ALL filter mini-albums (gallery + per-photo view pages) reusing
camera.tmpl/cameraview.tmpl. The galleries/view pages reuse the album's shared
photos/thumbs/blurs assets -- only the HTML differs.
Parallelism: filter pages render through the shared job pool, throttled to
IMAGE_JOBS (the same pool the album view pages use). The album render warms every
photo's EXIF cache (via details pages) before the parallel filter render, so the
filter jobs only read the cache.
Tests updated for the new STATS_FILTER_* structures and extended to assert
non-camera filter mini-albums (orientation, ISO) and their stats-page links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/album.source.sh')
| -rw-r--r-- | src/lib/album.source.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/album.source.sh b/src/lib/album.source.sh index 65282f1..7225492 100644 --- a/src/lib/album.source.sh +++ b/src/lib/album.source.sh @@ -1,8 +1,8 @@ # Maps each album photo filename to its view-page basename ("<page>-<preview>") -# as assigned during render_album_pages. The stats camera pages read this so -# their thumbnails link into the album view (with navigation, details, and the -# EXIF tooltip) exactly like the main album, instead of the raw image. Declared -# globally so it always exists for callers even when no album was rendered. +# as assigned during render_album_pages. The stats filter mini-albums read this +# so each view page can link "Details" to the album's own details page for the +# photo. Declared globally so it always exists for callers even when no album +# was rendered. declare -gA ALBUM_VIEW_PAGE_BY_PHOTO=() album_photo_files() { @@ -796,8 +796,8 @@ render_album_pages() { render_failed record_rendered_view_page rendered_view_pages rendered_last_views \ "$num" "$i" - # Read later by the stats camera pages (render_camera_pages); shellcheck - # cannot see that cross-function use. + # Read later by the stats filter mini-albums (render_filter_pages) for + # their Details links; shellcheck cannot see that cross-function use. # shellcheck disable=SC2034 ALBUM_VIEW_PAGE_BY_PHOTO["$photo"]="$num-$i" done < <(album_photo_files "$photos_dir") @@ -1073,7 +1073,7 @@ generate_stats_pages() { log_verbose 'Stats page enabled; collecting EXIF stats' collect_photo_exif_stats render_stats_page . . - render_camera_pages . . + render_filter_pages . . } generate() { |
