diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-18 16:22:22 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-18 16:22:22 +0300 |
| commit | 3a3ae4a4424136ad4a5be636c06fe036711558a2 (patch) | |
| tree | 7b2cfe72bec40436196b7ae984ba126a401d2ae7 /src/lib/generation-metadata.source.sh | |
| parent | 42036d5ec36160a9caa6de64f9476726a5386a69 (diff) | |
Add CHRONOLOGICAL_ORDER config option to order albums by EXIF date taken
Adds a new yes/no config setting (default no, preserving current behavior)
that orders the main album's photos by EXIF date taken (ascending) instead
of the default filename/shuffle order. Reuses the existing EXIF cache and
tag fallback chain (DateTimeOriginal -> DateTimeDigitized -> DateTime)
already used for tooltips/details/stats, so ordering never disagrees with
what those features show. Photos with no usable EXIF date fall back to
their source file's mtime, staying fully deterministic and crash-free.
CHRONOLOGICAL_ORDER takes precedence over SHUFFLE when both are enabled,
documented in album-photo-select.source.sh and docs/configuration.md.
Wired through the config registry (CONFIG_SPECS), validation, CLI flags
(--chronological/--no-chronological), --print-config, --dry-run,
--verbose logging, and shuriken.json generation metadata. Adds unit and
end-to-end tests covering default-off behavior, EXIF-date ordering with
shuffle precedence, and mtime fallback for EXIF-less photos.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/generation-metadata.source.sh')
| -rw-r--r-- | src/lib/generation-metadata.source.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/generation-metadata.source.sh b/src/lib/generation-metadata.source.sh index 20f5d09..c765f1c 100644 --- a/src/lib/generation-metadata.source.sh +++ b/src/lib/generation-metadata.source.sh @@ -42,6 +42,7 @@ _collect_generation_metadata() { _GENERATION_METADATA["settings_feature_percent"]="$THUMB_FEATURE_PERCENT" _GENERATION_METADATA["settings_image_jobs"]="$IMAGE_JOBS" _GENERATION_METADATA["settings_random_seed"]="$RANDOM_SEED" + _GENERATION_METADATA["settings_chronological_order"]="$CHRONOLOGICAL_ORDER" _GENERATION_METADATA["settings_shuffle"]="$SHUFFLE" _GENERATION_METADATA["settings_splash_page"]="$SPLASH_PAGE" _GENERATION_METADATA["settings_details_page"]="$DETAILS_PAGE" @@ -112,6 +113,8 @@ _generation_metadata_json_settings() { "$(json_string "${_GENERATION_METADATA["settings_image_jobs"]}")" printf ' "random_seed": %s,\n' \ "$(json_string "${_GENERATION_METADATA["settings_random_seed"]}")" + printf ' "chronological_order": %s,\n' \ + "$(json_bool "${_GENERATION_METADATA["settings_chronological_order"]}")" printf ' "shuffle": %s,\n' \ "$(json_bool "${_GENERATION_METADATA["settings_shuffle"]}")" printf ' "splash_page": %s,\n' \ |
