Clip counts on listings, so clients find photos with only clips #210

Merged
cameron merged 1 commits from feat/clip-counts into master 2026-11-02 00:54:24 +00:00
Owner

Follow-up to #209 (part of #208).

Clips aren't counted as versions, which was intended, but it means a photo whose only derived file is a clip looked like a plain photo. FileViewer only fetches /image/versions for photos with photo_version_counts > 0, so it never saw the clip.

  • PhotoVersionSummary gains clip_count, counted the same way as versions (live rows only), restricted to CLIP_KINDS. Photos with only clips now get a summary too.
  • /photos: a new parallel array, photo_clip_counts.
  • Records (memories, search hits, /photos/exif): a new clip_count field.
  • Everything is skipped when zero, so responses without clips are byte-identical.
  • CLAUDE.md is updated.

Testing

  • cargo test --lib (DATABASE_URL=:memory:): 1063 pass.
  • The end-to-end clip test now also asserts photo_clip_counts: [1] with no photo_version_counts.
  • The VersionFields serialisation test covers the clips-only case.
  • fmt and clippy are clean.

🤖 Generated with Claude Code

Follow-up to #209 (part of #208). Clips aren't counted as versions, which was intended, but it means a photo whose only derived file is a clip looked like a plain photo. FileViewer only fetches `/image/versions` for photos with `photo_version_counts > 0`, so it never saw the clip. - `PhotoVersionSummary` gains `clip_count`, counted the same way as versions (live rows only), restricted to `CLIP_KINDS`. Photos with only clips now get a summary too. - **`/photos`:** a new parallel array, `photo_clip_counts`. - **Records** (memories, search hits, `/photos/exif`): a new `clip_count` field. - Everything is skipped when zero, so responses without clips are byte-identical. - CLAUDE.md is updated. ## Testing - `cargo test --lib` (`DATABASE_URL=:memory:`): 1063 pass. - The end-to-end clip test now also asserts `photo_clip_counts: [1]` with no `photo_version_counts`. - The `VersionFields` serialisation test covers the clips-only case. - fmt and clippy are clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cameron added 1 commit 2026-11-02 00:49:25 +00:00
Derived clips (#208) aren't counted as versions, so a photo whose only
derived file is a clip looked like a plain photo, and clients never fetched
/image/versions for it. Summaries now carry clip_count: /photos adds the
parallel array photo_clip_counts, records (memories, search, /photos/exif)
carry clip_count. All skipped when zero, so other responses are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cameron merged commit f121457c43 into master 2026-11-02 00:54:24 +00:00
cameron deleted branch feat/clip-counts 2026-11-02 00:54:25 +00:00
Sign in to join this conversation.