image_exif: manual date_taken override (set/clear endpoints)
Add `POST /image/exif/date` and `POST /image/exif/date/clear` so an operator can correct a row whose canonical-date waterfall landed on the wrong value (camera clock reset, fs_time fallback for a copied-from- backup file, etc). New `original_date_taken` / `original_date_taken_source` columns snapshot the prior value on first override so revert is lossless. The waterfall source set is now `'exif' | 'exiftool' | 'filename' | 'fs_time' | 'manual'`. The existing `idx_image_exif_date_backfill` partial index already filters to `date_taken IS NULL OR date_taken_source = 'fs_time'`, so manual rows are naturally excluded from the per-tick drain — no index change needed. `ExifMetadata` now exposes `date_taken_source` + originals so a UI can render "manually set; was X via filename". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
15
migrations/2026-05-06-000200_add_manual_date_override/up.sql
Normal file
15
migrations/2026-05-06-000200_add_manual_date_override/up.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Manual date_taken override: when an operator overrides a row's date via
|
||||
-- POST /image/exif/date, the prior `(date_taken, date_taken_source)` is
|
||||
-- snapshotted into these columns and the live columns hold the new value
|
||||
-- with `date_taken_source = 'manual'`. POST /image/exif/date/clear restores
|
||||
-- the pair and nulls the originals.
|
||||
--
|
||||
-- The waterfall source-name set is now:
|
||||
-- 'exif' | 'exiftool' | 'filename' | 'fs_time' | 'manual'
|
||||
--
|
||||
-- The `idx_image_exif_date_backfill` partial index already filters to
|
||||
-- `date_taken IS NULL OR date_taken_source = 'fs_time'`, so 'manual' rows
|
||||
-- are naturally excluded from the per-tick backfill drain — no index
|
||||
-- change needed.
|
||||
ALTER TABLE image_exif ADD COLUMN original_date_taken BIGINT;
|
||||
ALTER TABLE image_exif ADD COLUMN original_date_taken_source TEXT;
|
||||
Reference in New Issue
Block a user