Dates: serve the display wall clock (wall_clock) to clients
Every payload a client renders a capture time from now carries `wall_clock`, a naive ISO-8601 string computed by the existing `date_view::row_display_wall`: the camera's wall clock (true instant + camera offset; the owner's display zone without an offset), with the per-source fallback for unconverted rows. Clients render it verbatim and do no zone math, which is the FileViewer-React #33 / Apollo #37 flip with the rule kept server-side: the drain's permanent `date_utc IS NULL` floor (#120: edited/exported files) would otherwise force every client to carry the per-source legacy conventions forever, and insight prompts already use the same function, so prompt and UI agree by construction. - `/image/metadata` (+ the GPS / date / date-clear mutation responses): `file_wall_clock` — the row's wall, else the filename-class date, else the earliest fs time in the display zone (unindexed files). - `/memories` items and `/photos/gps-summary` photos: `row_wall_clock`. - `get_all_with_gps` returns full rows instead of a 7-tuple that dropped `date_taken_source`, which unconverted rows need. - `date_view::owner_display_zone` resolves prefs -> app default per request. Legacy fields are untouched, so current clients see byte-identical responses (additive; safe to deploy ahead of the client flip, per #120). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0c6c696f2
commit
e2f33684c8
8 files changed
+257
-93
No files matched your search
@@ -259,6 +259,10 @@ pub struct MetadataResponse {
|
||||
pub filename_date: Option<i64>, // Date extracted from filename
|
||||
pub library_id: Option<i32>,
|
||||
pub library_name: Option<String>,
|
||||
/// The capture wall clock to display, naive ISO-8601
|
||||
/// (`2018-09-29T14:00:00`) — `date_view::file_wall_clock`. Render it
|
||||
/// verbatim; never zone-convert it (ADR-0001).
|
||||
pub wall_clock: Option<String>,
|
||||
}
|
||||
|
||||
impl From<fs::Metadata> for MetadataResponse {
|
||||
@@ -277,6 +281,7 @@ impl From<fs::Metadata> for MetadataResponse {
|
||||
filename_date: None, // Will be set in endpoint handler
|
||||
library_id: None,
|
||||
library_name: None,
|
||||
wall_clock: None, // Set in the endpoint handler
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,6 +442,9 @@ pub struct GpsPhotoSummary {
|
||||
/// Which evidence pinned the instant (`offset_tag`, `gps`,
|
||||
/// `assumed_server`, `utc_direct`, `manual`).
|
||||
pub date_taken_tz_source: Option<String>,
|
||||
/// Capture wall clock to display (naive ISO-8601; see
|
||||
/// `MetadataResponse::wall_clock`).
|
||||
pub wall_clock: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
|
||||
Reference in new issue
Block a user