Skip to content

feat: tz-audit and tz-set client workflows (#45) - #48

Open
dhcgn wants to merge 1 commit into
mainfrom
feature/tz-set
Open

dhcgn wants to merge 1 commit into
mainfrom
feature/tz-set

Conversation

@dhcgn

@dhcgn dhcgn commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Closes #45

What

  • cw tz-audit (read-only): classifies every asset by exifInfo.timeZone — none, utc, offset, iana, dst-mismatch (needs --reference-zone), iana-inconsistent — with counts and top cameras per class, then lists every distinct time zone value with its asset count. --class NAME lists assets, -q prints IDs for piping, --json includes classes and timeZones. Takes the search metadata filter flags.
  • cw tz-set --time-zone <IANA>: for assets with no time zone, computes the zone's DST-correct offset at each asset's wall-clock time and sets dateTimeOriginal with that offset via PUT /assets/{id}. The shown time stays the same. Assets that already have a zone or no dateTimeOriginal are skipped, so reruns are no-ops. Supports --dry-run, --yes (required for stdin IDs), and IDs, links or search filters.

Notable finding

Immich v3.4.2 cannot persist an IANA name without GPS. After the sidecar write and metadata re-extraction, the stored zone is the fixed offset (UTC+1/UTC+2). I verified this on staging; the help text and docs say so.

Also

  • Spec bumped to Immich v3.4.2. updateAsset/updateAssets are no longer deprecated, so the AGENTS.md exception and the deprecation notes in assets update, fix-album-dates and date-from-ocr are removed.
  • The search filter flags are now shared (searchFilterFlags / buildSearchFilter).
  • time/tzdata is embedded so IANA zones resolve on Windows (about 450 KB larger binary).
  • Docs, skill best practices, the regenerated SKILL.md and the README table are updated.

Tests

  • Unit tests: classification, keeping the wall clock across DST, skip rules, zone validation, and the audit time zone list.
  • Staging roundtrip (-tags integration): upload a JPEG with a naive date, run tz-set, check UTC+2 and the instant, then force-delete.
  • Read-only prod check: tz-audit, and tz-set with --dry-run.
  • Local CI equivalent passes: generate, build, test, vet, fix.

🤖 Generated with Claude Code

- cw tz-audit (read-only): counts assets per time zone class (none, utc,
  offset, iana, dst-mismatch, iana-inconsistent) with top cameras, lists
  every distinct exifInfo.timeZone value with its asset count, --class
  listing, --ids-only for piping, --json.
- cw tz-set: gives assets without any time zone the DST-correct offset of
  an IANA zone via updateAsset, keeping the wall-clock time; skips assets
  that already have a zone or no dateTimeOriginal, so reruns are no-ops.
  Immich v3.4 stores the result as a fixed offset (UTC+1/UTC+2).
- Spec bumped to Immich v3.4.2: updateAsset/updateAssets are no longer
  deprecated; removed the documented exception and deprecation notes.
- search metadata filter flags shared via searchFilterFlags/buildSearchFilter.
- Embed time/tzdata so IANA zones resolve on Windows.
- Unit tests plus a self-cleaning staging roundtrip test.

Closes #45

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Preview binaries (commit c47e555)

Download test executables for this PR (linux/darwin/windows + checksums.txt) from the run's Artifacts section (GitHub login required):
https://github.com/dhcgn/immich-admin-cli/actions/runs/45036479529#artifacts

Or with the CLI: gh run download 45036479529 -n immich-admin-pr-48 -R dhcgn/immich-admin-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client-workflow tz-audit + tz-set: report time zone classes and assign an IANA zone to assets without one

1 participant