Photo: save path, is-local, content bytes, metadata and EXIF getters (closes #141) #142

Merged
clawbot merged 4 commits from issue-141-photo-getters into next 2026-10-01 17:58:24 +02:00
2 changed files with 10 additions and 7 deletions
Showing only changes of commit 824b2dbd76 - Show all commits
+5 -4
View File
@@ -699,10 +699,11 @@ synchronous getters look at the disk and never touch the network:
- `photo.savePath` → `string | undefined` — where `lib.backup()` writes the - `photo.savePath` → `string | undefined` — where `lib.backup()` writes the
original, `originals/<fileID>.<ext>` under the `downloadDirectory` the library original, `originals/<fileID>.<ext>` under the `downloadDirectory` the library
was opened with, whether or not it is there yet. For a live photo the backup was opened with, whether or not it is there yet: for a live photo already
has stored, it is the image's path, whose extension comes from inside the live stored, its image. For a live photo not yet stored, it carries the title's
photo and can differ from the title's. `undefined` when the library has no extension, and the backup may store the image under a different one, found
`downloadDirectory` or no content source. inside the live photo. `undefined` when the library has no `downloadDirectory`
or no content source.
- `photo.isLocal` → `boolean` — whether the whole original is at `savePath`. - `photo.isLocal` → `boolean` — whether the whole original is at `savePath`.
Four async methods may download: Four async methods may download:
+5 -3
View File
@@ -89,9 +89,11 @@ export class Photo {
return this.rec.isHidden; return this.rec.isHidden;
} }
// The path `lib.backup()` writes the original to in the library's download // Where `lib.backup()` stores the original in the library's download
// directory, whether or not it is there yet; for a live photo, its image. // directory, whether or not it is there yet: for a live photo already
// Undefined when the library has no download directory or no content // stored, its 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 when the library has no download directory or no content
// cache. // cache.
get savePath(): string | undefined { get savePath(): string | undefined {
return this.cache?.savePath(this.rec.fileID); return this.cache?.savePath(this.rec.fileID);