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

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>
This commit is contained in:
Cameron CordesandClaude Opus 5.5 committed 2026-11-01 19:49:21 -05:00
1 parent 19cbc9d59c
commit 3d1db90e3c
7 files changed
+84 -25

No files matched your search

+3 -1
View File
@@ -798,10 +798,12 @@ async fn an_animated_clip_links_hides_and_is_listed_apart_from_versions() {
);
let app = photos_app!(fx);
// Hidden behind the photo, like a version, and not counted as one.
// Hidden behind the photo, like a version, and counted as a clip, not a
// version (so the viewer knows to fetch /image/versions for it).
let (_, body) = get_json!(app, "/photos?path=&recursive=true&sort=nameasc");
assert_eq!(body["photos"], serde_json::json!(["2014/IMG_1.JPG"]));
assert!(body.get("photo_version_counts").is_none(), "{body}");
assert_eq!(body["photo_clip_counts"], serde_json::json!([1]));
// Listed under `clips`, from the photo's path or the clip's own.
for path in ["2014/IMG_1.JPG", rel] {