Repository navigation
feat(imports): date photos and videos by when they were taken, from the file itself - #674
Merged
Merged
Conversation
…he file itself Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
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.
Requested by Adeel · project thread
Description
Before: an asset whose file name held no date was dated by the file's last change, so a photo copied off a phone showed the day it was copied.
After: an asset uploaded, scanned or imported is dated by its own file when its name gives no date: a photo by its EXIF (
DateTimeOriginal, elseDateTime), a video or recording by its creation time (QuickTime'screationdate, elsecreation_time), and only then by the file's last change. A photo's GPS fix is kept as itsplace(lat,lon), whichGET /recordings/{rid}and MCPget_recordinggive to its namespace's members. A date in its name, or one its source gives, still wins, and a clock never set (1970, 1904) dates nothing.How:
ingest.pyreads the dates with the libraries Lens already ships (Pillow for EXIF, ffprobe's format tags for media);uploads.pypasses the date found to the asset.Motivation and Context
Item from the personal feature plan sheet ("photos sorted by when they were taken").
Screenshots (if appropriate):
n/a
Steps to reproduce (if appropriate):
Upload a phone photo named
IMG_1234.jpg: its date is the moment it was taken.Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_file_dates.py).docs/accordingly (docs/processing.md, When an asset was made;docs/api.md).## UnreleasedinCHANGELOG.md. Written aschangelog.d/file-dates.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.Done questions (AGENTS.md)
dateandplaceonGET /recordings/{rid}and MCPget_recording..envedit or manual step.placeis a new optional field.make openapi).Local CI (
ci/local-ci.sh): FastAPI (embedded and server), Next.js, pre-commit and PR title passed.Generated by Claude Code