Skip to content

Promote Develop: Catalog Columns, Live Photo Pairing, and Operations Guides - #283

Merged
ptr727 merged 3 commits into
mainfrom
develop
Nov 18, 2026
Merged

ptr727 merged 3 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes develop to main. The head is develop itself, and git merge-tree --write-tree origin/main origin/develop reports no conflict.

Constituents:

Closes #274

The comments label is set because #275 adds code comment lines.

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 17, 2026 10:08
* Add Catalog Columns and DB-Backed Live Photo Pairing

Add content_identifier, image_hash and metadata_read columns to the
files table, upgraded in place on open. The catalog fills them in one
exiftool run that also returns the image data hash, which needs
ExifTool 12.63 or newer.

Make process catalog every file first, then run the per-file pipeline.
With --db a Live Photo video finds its still by ContentIdentifier among
catalogued image rows, whatever the name or folder. Without --db the
same-folder name lookup is unchanged.

Tracks #274.

* Guard Live Photo Pairing Against Self-Match and Error Rows

A video never pairs with a catalog row holding its own content, which a
stale name under an image extension could otherwise produce. A file
that exiftool reports an error for stays unread instead of being stored
as having no tags. A read-only database in the old shape still answers
hash lookups, and the unused partial-schema guard is removed.

Tracks #274.

* Keep the Row of a Trashed Still So Live Pairing Is Order Independent

Deleting a file trashed in Immich no longer deletes its catalog row,
so a Live Photo video pairs with a trashed still whichever of the two
process handles first. Add tests for the trashed-still order and for the
video sorting before its still, and document the cost of the two
exiftool runs per new file.

Tracks #274.

* Keep verify Free of exiftool and Tighten Catalog Docs and Tests

Verify indexes without reading catalog metadata, so it needs no
exiftool and no longer hashes image data for every already verified
file. Reuse the pre-process SHA-256 for the Live pairing exclusion,
drop the unused row delete, and correct the documentation of the
upgrade and rehash behavior.

Tracks #274.

* Correct Catalog Docs for Rehash, Import and Verify

Tracks #274.

* Add ProcessCommand Test for the Catalog Phase

The test starts with both files unindexed and the video listed before
its still. It fails when the catalog phase is removed.

Tracks #274.

* Correct README Backfill Note for Import

Import skips a known source before reading metadata, so only index and
process backfill an old row.

Tracks #274.

* Run Index Cache Tests Without exiftool

The IndexTask cache tests index dummy text files and need no metadata,
so they read none. They pass on a runner with no exiftool installed.

Tracks #274.

* Run Schema Tests Without Tools and Skip on Old exiftool

Move the schema and mapping tests to a class with no tool dependency so
they run on a runner without exiftool. The media fixture skips instead
of failing when the installed exiftool is older than the minimum.

Tracks #274.

* Fail Clearly on an Old exiftool in the Media Fixture

The media fixture stays unchanged, so a host with an exiftool older than
the minimum fails with the version message instead of skipping tests
that never read catalog metadata.

Tracks #274.

* Exclude Same-Media Rows From Live Photo Pairing

A catalog row whose image hash equals the video's own never counts as
its still, so a copy of one video under an image extension no longer
deletes the video. Test stills use a different video as their media.
List the new test files in the architecture notes.

Tracks #274.

* Isolate the SHA-256 Exclusion in the Stale Row Test

The stale row has no image hash, so only the SHA-256 exclusion can keep
the video from pairing with itself. Correct the stale fixture comment.

Tracks #274.
* Document the rclone Mirror and Originals Archive Workflow

Replace the kei downloader section in the README workflow example with an rclone mirror of iCloud Photos that feeds an Originals archive, then a processing directory. Fixes #274.

* Address review findings in the rclone workflow docs

Name the PrimarySync All Photos path in the rclone sync, correct the trash database prerequisite, and fix wording and spelling findings.

* Generalize the README workflow example around a sync mirror source

Frame the section around a syncing mirror of a cloud photo library, with rclone and iCloud Photos as the example, and word the source-adoption paragraph without naming a tool.
* Add Operations Guide for Archive and Duplicate Elimination

Document building an originals archive from a syncing mirror, adopting a new
source for a library the photo server already holds, the limits of each
matching key, and what to check in a cloud export.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Correct Guide Claims Found in Local Review

Align trash database advice, row deletion, Live Photo conditions, no-date
handling, duplicate copies, and GIF conversion with the code and README.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Fix Trash Hash Cause, Index Database, and GIF Scope in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Note the Database Requirement and GIF Follow-Up in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Correct Guide Pairing and GIF Backup Wording

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Qualify Removal and Duplicate Cleanup Advice in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Fix Remaining Guide Inaccuracies and Add Process DB Note

Name the upload evidence, qualify the duplicate and import database claims,
add the Originals ordering and byte-identity caveat, describe in-batch
twins, and note the process trash check needs a database.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Qualify Trash Variant, Upload Evidence, and Trash Row Removal in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Describe Trash Row Encoding and Upload Evidence in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Select the Trash Row by Converted Checksum in Guide

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Describe Restored Asset Hash Removal in Guide and README

Co-Authored-By: Claude Fable 5.2 <[email protected]>

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 18, 2026
Copilot AI lite review requested due to automatic review settings November 18, 2026 03:17
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.03226% with 242 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.25%. Comparing base (8110f35) to head (64380a0).
⚠️ Report is 258 commits behind head on main.

Files with missing lines Patch % Lines
PhotoCleaner/Database.cs 56.12% 63 Missing and 5 partials ⚠️
PhotoCleaner/ProcessTask.cs 0.00% 53 Missing ⚠️
PhotoCleaner/MediaUtilities.cs 2.22% 44 Missing ⚠️
PhotoCleaner/IndexTask.cs 26.31% 26 Missing and 2 partials ⚠️
PhotoCleaner/ProcessCommand.cs 0.00% 28 Missing ⚠️
PhotoCleaner/ImportTask.cs 0.00% 15 Missing ⚠️
PhotoCleaner/DatabaseScope.cs 0.00% 5 Missing ⚠️
PhotoCleaner/VerifyCommand.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
- Coverage   43.37%   41.25%   -2.13%     
==========================================
  Files          28       27       -1     
  Lines        3896     4138     +242     
  Branches      306      362      +56     
==========================================
+ Hits         1690     1707      +17     
- Misses       2154     2361     +207     
- Partials       52       70      +18     
Flag Coverage Δ
dotnet 41.25% <29.03%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active moderate issue removes the Keys:ContentIdentifier fallback still required by live-photo writers and tests, causing ExifTool deserialization to miss identifiers and retain videos that should be deleted.

1 open issue
What changed in this PR

This PR promotes catalog-backed Live Photo pairing and operational documentation from develop to main, adding metadata indexing, archive workflows, and updated processing behavior.

Changes:

  • Adds catalog metadata columns, schema upgrades, image-data hashing, and database-backed Live Photo pairing.
  • Introduces a cataloging phase before processing while preserving rows for trashed files.
  • Updates README, architecture, governance, and operations documentation for mirroring, archiving, deduplication, and cloud-photo workflows.
  • Expands tests for catalog metadata, schema migration, pairing behavior, processing order, and trash handling.
File Description
README.md Updates documentation for catalog fields, Live Photo pairing, trash behavior, verification, and mirror workflows.
PhotoCleanerTests/​ProcessTaskTests.cs Updates processing tests to verify that database rows remain after files are trashed.
PhotoCleanerTests/​LivePhotoCatalogTests.cs Adds tests for catalog metadata, schema behavior, image hashes, ordering, and database-backed Live Photo pairing.
PhotoCleanerTests/​IndexTaskTests.cs Adjusts indexing tests for configurable metadata reads.
PhotoCleanerTests/​CatalogSchemaTests.cs Adds coverage for catalog schema upgrades and metadata mapping.
PhotoCleaner/​VerifyTask.cs Disables catalog metadata reads during verification indexing.
PhotoCleaner/​VerifyCommand.cs Configures verification database handling without catalog metadata validation.
PhotoCleaner/​ProcessTask.cs Implements catalog-based Live Photo matching and retains rows for deleted still files.
PhotoCleaner/​ProcessCommand.cs Adds a cataloging phase before parallel file processing.
PhotoCleaner/​MediaUtilities.cs Adds ExifTool capability checks and catalog metadata reads including image hashes.
PhotoCleaner/​IndexTask.cs Reads, stores, and backfills catalog metadata during indexing.
PhotoCleaner/​ImportTask.cs Stores catalog metadata during database-backed imports.
PhotoCleaner/​ExifToolJson.cs Adds image-data hash deserialization and updates ContentIdentifier metadata mappings.
PhotoCleaner/​DatabaseScope.cs Adds configurable catalog metadata capability validation for database operations.
PhotoCleaner/​Database.cs Extends the schema and migration logic with metadata persistence and Live Photo lookup support.
OPERATIONS.md Documents the ExifTool version requirement for catalog metadata reads.
GUIDE.md Adds operational guidance for archives, source adoption, duplicate elimination, trash handling, and Live Photos.
GOVERNANCE.md Adds the operations guide to the documented repository layout.
ARCHITECTURE.md Documents catalog metadata, schema behavior, two-phase processing, and updated Live Photo rules.

Review effort: Lite

Comment thread PhotoCleaner/ExifToolJson.cs Resolved
@ptr727
ptr727 merged commit d95e210 into main Nov 18, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Catalog Columns and DB-Backed Live Photo Pairing

2 participants