Photo: drop fileSize, exif() throws without a content cache
check / check (push) Successful in 1m58s
check / check (push) Successful in 1m58s
Remove fileSize from Photo, PhotoRecord, README and TODO.md: the server's
value is the size of the encrypted file, not the original's.
exif() now checks for the content cache before it returns {} for a video,
so it throws like original(), thumbnail() and content() when the library
has no content source. README names the methods that also serve an
original from the backup, since thumbnail() does not.
New tests: exif() on a JPEG whose EXIF block cannot be parsed returns {},
and exif() on a video throws without a content source.
Model: opus-5-5
This commit is contained in:
@@ -209,7 +209,7 @@ describe("lib.photos", () => {
|
||||
expect("key" in photo.record()).toBe(false);
|
||||
});
|
||||
|
||||
it("byID exposes modifiedAt, hash, fileSize and the year taken", () => {
|
||||
it("byID exposes modifiedAt, hash and the year taken", () => {
|
||||
// Mid-July, so the year is 2021 in every time zone.
|
||||
const takenAt = Date.UTC(2021, 6, 15, 12);
|
||||
const records = deriveRecords(
|
||||
@@ -223,14 +223,12 @@ describe("lib.photos", () => {
|
||||
modificationTime: micros(1_700_000_123_456),
|
||||
hash: "aGFzaA==",
|
||||
},
|
||||
file: { decryptionHeader: "aGVhZGVy", size: 2_048_000 },
|
||||
}),
|
||||
],
|
||||
);
|
||||
const photo = apis(records).photos.byID({ fileID: 1001 })!;
|
||||
expect(photo.modifiedAt).toBe(ms(1_700_000_123_456));
|
||||
expect(photo.hash).toBe("aGFzaA==");
|
||||
expect(photo.fileSize).toBe(2_048_000);
|
||||
expect(photo.year).toBe(2021);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user