The exiftool branch of the date waterfall now pulls raw strings with group prefixes (one `exiftool -j -q -G1` subprocess per batch, no `-d %s`) and classifies each candidate: - zoned strings (own offset / Z) are true instants; - naive strings from container groups (QuickTime/Track*/Apple) are UTC-rendered creation_time fields -> true instants (utc_direct). Running them through the camera wall-clock cascade was the "videos off by 4-5 hours" bug: it reinterpreted a UTC instant in the server zone; - naive strings from photo-EXIF groups are camera wall clocks and run the offset cascade (OffsetTime* pairing + GPS evidence pulled in the same exiftool pass). The legacy date_taken column stays byte-identical to the old server-local interpretation (reproduced in Rust, DST-aware); the new-contract date_utc / camera_offset_minutes / date_taken_tz_source columns carry the true instant. Manual date edit (POST /image/exif/date) reinterprets the naive-as-UTC epoch the client sent as a wall clock in the user's display zone (camera_tz::manual_date_resolution, tz_source = 'manual'), snapshots the pre-override new-contract triple next to the existing legacy snapshot pair (3 new columns, migration 2026-09-25-000000), and revert restores both pairs. ADR-0001 records the container-date finding; CLAUDE.md date-pipeline section updated.
14 lines
708 B
SQL
14 lines
708 B
SQL
-- Manual date-edit rework (ticket #115).
|
|
--
|
|
-- POST /image/exif/date now writes the new-contract triple
|
|
-- (date_utc, camera_offset_minutes, date_taken_tz_source = 'manual')
|
|
-- alongside the legacy (date_taken, date_taken_source) pair. Reverting an
|
|
-- override must restore the resolver's new-contract triple as well as the
|
|
-- legacy pair, so image_exif snapshots the pre-override new-contract
|
|
-- columns next to the existing legacy snapshot pair
|
|
-- (original_date_taken / original_date_taken_source).
|
|
|
|
ALTER TABLE image_exif ADD COLUMN original_date_utc BIGINT;
|
|
ALTER TABLE image_exif ADD COLUMN original_camera_offset_minutes INTEGER;
|
|
ALTER TABLE image_exif ADD COLUMN original_date_taken_tz_source TEXT;
|