Skip to content

feat: the time of the shot and the camera in the image listings - #2697

Merged
eddy-geek merged 2 commits into
masterfrom
feat/image-listing-date-time
Nov 23, 2026
Merged

eddy-geek merged 2 commits into
masterfrom
feat/image-listing-date-time

Conversation

@eddy-geek

Copy link
Copy Markdown
Contributor

Adds date_time and camera_name to the image listing fields. They show up in GET /images and in the associations.images of every document, e.g. an outing.

Why

The UI locates an outing's images on its GPS track (c2corg/c2c_ui#4259, c2corg/c2c_ui#5224). It needs each image's shooting time and camera, which today means one GET /images/:id per image. A user's backfill scan therefore made about 40 requests per outing, roughly 6000 for one account with 196 tracked outings, and hit the rate limit (429). With these fields the scan needs 1 request per outing.

The time each photo was taken is also useful elsewhere in the UI: galleries, map popups, grouping by day on multi-day outings.

Cost

  • Two columns of the same rows that are already loaded (get_linked_images already sorts by Image.date_time), so no extra query.
  • A few bytes per image in the JSON.

Tests

  • test_get_collection checks both fields. It fails without the change (KeyError: 'date_time').
  • test_image.py and test_outing.py have the same results with and without the change. The only failure, test_put_success_association_update, also fails on master in my local stack.

The images of a document (associations) and the image listings give
date_time and camera_name: the UI locates the images of an outing on
its GPS track without reading each image (c2corg/c2c_ui#4259), which
took a request per image and hit the rate limit on large accounts.
Two columns of the rows already loaded: no other query.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

eddy-geek pushed a commit to c2corg/c2c_ui that referenced this pull request Nov 23, 2026
With c2corg/v6_api#2697, the images of an outing come with the time of
their shot and their camera: the scan reads the outing alone, then only
the images to locate (to save them, and to know who may edit them),
instead of every image of the outing. Without these fields (an API not
updated yet), each image is read as before.
@eddy-geek
eddy-geek merged commit 375c0f2 into master Nov 23, 2026
7 checks passed
@eddy-geek
eddy-geek deleted the feat/image-listing-date-time branch November 23, 2026 18:35
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.

1 participant