Repository navigation
feat: the time of the shot and the camera in the image listings - #2697
Merged
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
date_timeandcamera_nameto the image listing fields. They show up inGET /imagesand in theassociations.imagesof 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/:idper 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
get_linked_imagesalready sorts byImage.date_time), so no extra query.Tests
test_get_collectionchecks both fields. It fails without the change (KeyError: 'date_time').test_image.pyandtest_outing.pyhave the same results with and without the change. The only failure,test_put_success_association_update, also fails on master in my local stack.