From b47fdda4fe1bf6fe90d0ba30eedac435dde7c034 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Tue, 12 May 2026 14:45:00 +0000 Subject: Add photo counts, EXIF details, video duration badges, slideshow launcher UI - Album cards show recursive photo count (bubbles up through sub-albums). - Lightbox info panel shows camera, aperture, shutter speed, and ISO; update.rb now extracts and stores these EXIF fields. - Video thumbnail cards show a duration badge (e.g. "1:23"). - Slideshow launcher redesigned: button on its own line, with Shuffle / Full screen / Interval options on a second line, all inside a rounded border to make the grouping clear. - Fixed album-actions alignment so Interval sits level with the checkboxes. Co-Authored-By: Claude Sonnet 4.6 --- scripts/update.rb | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'scripts/update.rb') diff --git a/scripts/update.rb b/scripts/update.rb index 9052341..0b052ba 100644 --- a/scripts/update.rb +++ b/scripts/update.rb @@ -80,15 +80,29 @@ end # ── Metadata enrichment ──────────────────────────────────────────────────────── def enrich_image(full, name, meta) - # EXIF date (skip if already recorded) - if meta['taken_at'].nil? + needs_exif = meta['taken_at'].nil? || meta['camera'].nil? || + meta['aperture'].nil? || meta['shutter'].nil? || meta['iso'].nil? + if needs_exif begin exif = MiniExiftool.new(full, numerical: false) - raw = exif.date_time_original || exif.create_date || exif.date_time - if raw - meta['taken_at'] = raw.respond_to?(:strftime) ? raw.strftime('%Y-%m-%dT%H:%M:%S') : raw.to_s - puts " #{name}: taken_at = #{meta['taken_at']}" + + if meta['taken_at'].nil? + raw = exif.date_time_original || exif.create_date || exif.date_time + if raw + meta['taken_at'] = raw.respond_to?(:strftime) ? raw.strftime('%Y-%m-%dT%H:%M:%S') : raw.to_s + puts " #{name}: taken_at = #{meta['taken_at']}" + end + end + + if meta['camera'].nil? + make = exif.make.to_s.strip + model = exif.model.to_s.strip + cam = model.downcase.start_with?(make.downcase) ? model : [make, model].reject(&:empty?).join(' ') + meta['camera'] = cam.empty? ? nil : cam end + meta['aperture'] ||= exif.f_number ? "f/#{exif.f_number}" : nil + meta['shutter'] ||= exif.exposure_time&.to_s + meta['iso'] ||= (exif.iso_speed_ratings || exif.iso)&.to_i rescue StandardError => e warn " #{name}: EXIF error — #{e.message}" end -- cgit v1.2.3