From af482f8eb43db63f6b18800dc4c0ed7141d5f16a Mon Sep 17 00:00:00 2001 From: sneak Date: Thu, 1 Oct 2026 15:49:53 +0000 Subject: [PATCH] savePath: state the live-photo caveat in content.ts and TODO.md The comment on ContentCache.savePath, a new comment on PhotoContent.savePath, and the TODO.md entry now say that for a live photo not yet stored, savePath carries the title's extension, and the backup may store the image under a different one. Model: opus-5-5 --- TODO.md | 13 +++++++------ src/library/content.ts | 7 ++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index 96f2732..4c188b5 100644 --- a/TODO.md +++ b/TODO.md @@ -27,12 +27,13 @@ declares one. - 2026-10-01: A `Photo` has `savePath`, `isLocal`, `content()`, `exif()`, `modifiedAt`, `hash` and `year` (issue 141). `savePath` is where - `lib.backup()` writes the original under the library's download directory, and - `isLocal` says whether the whole original is there; both look only at the - disk. `content()` returns the original's bytes and `exif()` the common EXIF - fields of a JPEG; both may download the original, and `exif()` downloads no - video. `PhotoRecord` gains `modifiedAt` and `hash`, and the JPEG EXIF scan - moved to `src/exif.ts`. + `lib.backup()` writes the original under the library's download directory; for + a live photo not yet stored, it carries the title's extension, and the backup + may store the image under a different one. `isLocal` says whether the whole + original is there. Both look only at the disk. `content()` returns the + original's bytes and `exif()` the common EXIF fields of a JPEG; both may + download the original, and `exif()` downloads no video. `PhotoRecord` gains + `modifiedAt` and `hash`, and the JPEG EXIF scan moved to `src/exif.ts`. - 2026-09-29: The "Workflow" list at the top of this file now says to branch from `next` and open a pull request that targets `next`, that the repository diff --git a/src/library/content.ts b/src/library/content.ts index 5b8805a..fea3b74 100644 --- a/src/library/content.ts +++ b/src/library/content.ts @@ -108,6 +108,9 @@ export interface ContentOptions { export interface PhotoContent { original(fileID: number, opts?: ContentOptions): Promise; thumbnail(fileID: number, opts?: ContentOptions): Promise; + // Where a backup stores the original, whether or not it is there yet. For + // a live photo not yet stored, it carries the title's extension, and the + // backup may store the image under a different one. savePath(fileID: number): string | undefined; isLocal(fileID: number): boolean; } @@ -439,7 +442,9 @@ export class ContentCache implements PhotoContent, ThumbnailsAPI { // Where a backup to the download directory stores the file's original, // whether or not it is there yet: for a live photo already stored, its - // image. Undefined with no download directory. + // image. For a live photo not yet stored, it carries the title's + // extension, and the backup may store the image under a different one. + // Undefined with no download directory. savePath(fileID: number): string | undefined { const file = this.getFile(fileID); if (this.downloadDirectory === undefined || file === undefined)