8000 feat(imports): date photos and videos by when they were taken, from the file itself by adeelahmad · Pull Request #674 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(imports): date photos and videos by when they were taken, from the file itself - #674

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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, else DateTime), a video or recording by its creation time (QuickTime's creationdate, else creation_time), and only then by the file's last change. A photo's GPS fix is kept as its place (lat, lon), which GET /recordings/{rid} and MCP get_recording give 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.py reads the dates with the libraries Lens already ships (Pillow for EXIF, ffprobe's format tags for media); uploads.py passes 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/api/test_file_dates.py).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/processing.md, When an asset was made; docs/api.md).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/file-dates.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. date and place on GET /recordings/{rid} and MCP get_recording.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. Nothing to do; dates come from the file.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models. Header reads only, with libraries already installed.
  • Private and secure: data local and encrypted, passkeys, threat model updated. The GPS fix stays on the asset, shown only to its namespace's members, like the file it came from.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged. A date in the name or from the source still wins.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). New assets only; existing dates are left as they are, and place is a new optional field.
  • Honest: sources cited; labelled built, in progress or planned.
  • Tests, docs and generated files updated (make openapi).
  • Open standards; dependencies keep Lens MIT. n/a: no new dependencies; EXIF and QuickTime tags are the standards read.
  • Result reported with evidence; "refine later" items written down. Refine later: re-date existing assets on request.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented.

Local CI (ci/local-ci.sh): FastAPI (embedded and server), Next.js, pre-commit and PR title passed.


Generated by Claude Code

…he file itself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit 1fe9a7c into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2026 05:22
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.

2 participants

0