diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-28 08:57:44 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-28 08:57:44 +0300 |
| commit | fef68fe90d7f00d7d831c335b03119f11c2c927b (patch) | |
| tree | c2f04c632e76a41732940bc947d896744dac6ba6 /src/lib/dry-run.source.sh | |
| parent | 5c7b3a78f2195c217453eda86818d340332e76c5 (diff) | |
or0: encapsulate STATS_* maps behind aggregator accessors
The stats reader modules (stats-render.source.sh, stats-filter-album.source.sh)
indexed stats-aggregate.source.sh's private STATS_* associative arrays directly,
so a key-convention change in the aggregator would silently break both readers.
Add a read API owned by stats-aggregate.source.sh (the data owner), mirroring
album-render's ALBUM_VIEW_PAGE_BY_PHOTO / album_view_page_for_photo split:
stats_total_photos - STATS_TOTALS[photos] denominator
stats_filter_pagebase - (prefix,label) -> pagebase, hiding the
STATS_FILTER_KEYSEP catkey encoding
stats_filter_title - STATS_FILTER_TITLE[pagebase]
stats_filter_photos - STATS_FILTER_PHOTOS[pagebase] list
stats_filter_count - number of filter mini-albums
stats_filter_pagebases - pagebases, LC_ALL=C-sorted (order owned here)
stats_category_count/size/max/keys_by_count_desc
- per-category count-array reads
Route every cross-module STATS_* read through these accessors. The render
module's _stats_max_count / _stats_keys_by_count_desc were duplicates of the new
stats_category_max / stats_category_keys_by_count_desc, so they are removed.
Behavior preserved exactly: missing-key semantics, iteration order (ordered
ladders, calendar months, count-desc with LC_ALL=C tie-break, sorted pagebase
enqueue) and generated HTML are byte-identical. Header docs updated to describe
the accessor boundary. The arrays stay the backing store; only the cross-module
READ path is encapsulated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/dry-run.source.sh')
0 files changed, 0 insertions, 0 deletions
