mix phoenix_kit.storage.backfill_capture_dates (phoenix_kit v2.41.0)

Copy Markdown View Source

Dates the images and videos stored before capture dates existed (V200).

New uploads are dated as they are processed. Files stored earlier have no taken_at; this task walks every one of them, reads its bytes, and records when it was taken — from EXIF or the video container, else the date in its file name, else its upload time. See PhoenixKit.Modules.Storage.CaptureDate.

Runs the pass in this process, batch by batch, printing progress, and is safe to re-run: a file that already has a date from an equal or stronger source keeps it, and a date set by hand is never touched. To run the same pass in the background instead, call PhoenixKit.Modules.Storage.Workers.CaptureDateBackfillJob.enqueue/0.

Usage

$ mix phoenix_kit.storage.backfill_capture_dates

The task boots the host application. If it serves HTTP on boot and the server is already running, give it an unused port (PORT=4021 mix …).

Exits 1 when any file could not be recorded.