Skip to content

feat: include photo result summary counts in activity response #123

Description

@siculo

Summary

Add photo result summary counts to the GET /api/activities/{id}
response so that callers can quickly determine how many photos were
processed successfully and how many produced no content, without
having to fetch the full results endpoint.

Motivation

The results endpoint already exposes per-photo status, including
photos for which no content was generated. However, GET /api/activities/{id} returns no aggregated counts, forcing clients
to either call the results endpoint or display no summary at all.

Adding counts to the activity response enables the plugin to show
at a glance — directly in the activity list — how many photos
completed successfully and how many had no output (e.g.,
"522 processed · 23 without content").

Scope

API

  • Add a photo_summary object to the GET /api/activities/{id}
    response body:
    "photo_summary": {
      "total": 522,
      "completed": 499,
      "without_content": 23
    }
  • Compute counts from the existing per-photo result data; no new
    storage required
  • Return null for photo_summary if the activity has not yet
    started processing

Plugin

Documentation

  • Update the API reference for GET /api/activities/{id}

Acceptance criteria

  • GET /api/activities/{id} returns photo_summary with
    total, completed, and without_content
  • Counts match the per-photo data returned by the results endpoint
  • photo_summary is null for activities not yet started
  • Plugin displays the counts in the activity list
  • Existing activity responses without the field are not broken

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions